revert 499d0cca8eba56de7c58810c5be42b1b10066dd8
revert Update .gitea/workflows/build.yml
This commit is contained in:
parent
499d0cca8e
commit
c3898be100
@ -1,65 +1,59 @@
|
|||||||
name: Spring App CI
|
name: Spring App CI
|
||||||
'on':
|
|
||||||
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-jar:
|
build-jar:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
distribution: adopt
|
distribution: 'adopt'
|
||||||
|
|
||||||
- name: Grant execute permission for mvnw
|
- name: Grant execute permission for mvnw
|
||||||
run: chmod +x ./mvnw
|
run: chmod +x ./mvnw
|
||||||
|
|
||||||
- name: Build .jar with Maven
|
- name: Build .jar with Maven
|
||||||
run: './mvnw package spring-boot:repackage'
|
run: ./mvnw package spring-boot:repackage
|
||||||
build-image:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
steps:
|
|
||||||
- name: Initialize Docker runtime
|
- name: Initialize Docker runtime
|
||||||
run: >
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
|
|
||||||
apt-get install ca-certificates curl gnupg lsb-release -y
|
apt-get install ca-certificates curl gnupg lsb-release -y
|
||||||
|
|
||||||
install -m 0755 -d /etc/apt/keyrings
|
install -m 0755 -d /etc/apt/keyrings
|
||||||
|
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg
|
|
||||||
--dearmor -o /etc/apt/keyrings/docker.gpg
|
|
||||||
|
|
||||||
chmod a+r /etc/apt/keyrings/docker.gpg
|
chmod a+r /etc/apt/keyrings/docker.gpg
|
||||||
|
|
||||||
echo \
|
echo \
|
||||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
|
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
|
||||||
$(lsb_release -cs) stable" | \
|
$(lsb_release -cs) stable" | \
|
||||||
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
apt-get update
|
apt-get update
|
||||||
|
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin -y
|
||||||
|
|
||||||
apt-get install docker-ce docker-ce-cli containerd.io
|
build-image:
|
||||||
docker-buildx-plugin -y
|
runs-on: ubuntu-22.04
|
||||||
- name: Build Docker image
|
steps:
|
||||||
run: >-
|
- name: Build Docker image
|
||||||
docker build -t walzen665/spring-cicd-test:latest
|
run: docker build -t walzen665/spring-cicd-test:latest --build-arg="JAR_FILE=target/demo-0.0.1-SNAPSHOT-spring-boot.jar" .
|
||||||
--build-arg="JAR_FILE=target/demo-0.0.1-SNAPSHOT-spring-boot.jar" .
|
|
||||||
- name: Tag Docker image
|
- name: Tag Docker image
|
||||||
run: >-
|
run: docker tag walzen665/spring-cicd-test:latest git.walzen665.de/walzen665/spring-cicd-test:latest
|
||||||
docker tag walzen665/spring-cicd-test:latest
|
|
||||||
git.walzen665.de/walzen665/spring-cicd-test:latest
|
- name: Log in to Gitea Docker Registry
|
||||||
- name: Log in to Gitea Docker Registry
|
run: echo ${{ secrets.GITEAREGISTRYTOKEN }} | docker login -u ${{ secrets.GITEAREGISTRYUSERNAME }} --password-stdin https://git.walzen665.de
|
||||||
run: >-
|
|
||||||
echo ${{ secrets.GITEAREGISTRYTOKEN }} | docker login -u ${{
|
|
||||||
secrets.GITEAREGISTRYUSERNAME }} --password-stdin
|
|
||||||
https://git.walzen665.de
|
|
||||||
push-image:
|
push-image:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Push Docker Image to Gitea
|
- name: Push Docker Image to Gitea
|
||||||
run: 'docker push git.walzen665.de/walzen665/spring-cicd-test:latest'
|
run: docker push git.walzen665.de/walzen665/spring-cicd-test:latest
|
||||||
collect-artifacts:
|
collect-artifacts:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
@ -67,4 +61,4 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: artifacts
|
name: artifacts
|
||||||
path: target/*.jar
|
path: target/*.jar
|
Loading…
x
Reference in New Issue
Block a user