also use name and id #126
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish backend to DockerHub | |
on: | |
push: | |
branches: [ feature/* ] | |
paths: | |
- 'backend/src/**' | |
- 'backend/build.gradle' | |
- '.github/workflows/publish-backend-feature.yml' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
environment: Publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: adopt | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Java build | |
working-directory: ./backend | |
run: ./gradlew build --no-daemon | |
env: | |
REPO_USERNAME: '${{ secrets.REPO_GITHUB_NAME }}' | |
REPO_TOKEN: '${{ secrets.REPO_GITHUB_TOKEN }}' | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: backend/ | |
file: backend/src/main/docker/Dockerfile.jvm | |
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 | |
push: true | |
pull: true | |
tags: akop/home-system:unstable | |
deploy: | |
runs-on: ubuntu-latest | |
needs: publish | |
steps: | |
- uses: actions/checkout@v4 | |
- id: wireguard | |
uses: ./deploy/connect-with-wireguard | |
with: | |
client-private-key: ${{ secrets.WIREGUARD_CLIENT_PRIVATE_KEY }} | |
client-ip: ${{ secrets.WIREGUARD_CLIENT_IP }} | |
allowed-ips: ${{ secrets.WIREGUARD_ALLOWED_IPS }} | |
server-public-key: ${{ secrets.WIREGUARD_SERVER_PUBLIC_KEY }} | |
endpoint: ${{ secrets.WIREGUARD_ENDPOINT }} | |
- name: Deploy | |
uses: WyriHaximus/github-action-helm3@v3 | |
with: | |
exec: echo '${{ secrets.VALUES_YAML_HOME_SYSTEM_FEATURE }}' | helm upgrade akops-home-backend ./deploy/backend --install --wait --atomic --values - | |
kubeconfig: '${{ secrets.K8S_CONF_AKOP_ONLINE }}' | |