Skip to content

Deploy by @svifty7 #1225

Deploy by @svifty7

Deploy by @svifty7 #1225

Workflow file for this run

name: Deploy
run-name: Deploy by @${{ github.actor }}
on:
push:
branches:
- main
- dev
workflow_dispatch:
permissions:
deployments: write
contents: read
pages: write
actions: write
id-token: write
env:
REGISTRY: ghcr.io
concurrency:
group: deploy-${{ github.ref_name }}
cancel-in-progress: true
jobs:
build-front:
name: Frontend Build Workflow
uses: ./.github/workflows/build-frontend.yml
build:
name: Build Docker image
needs: build-front
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: front-app-${{ github.run_id }}
path: ./src/main/resources/static/
- name: Copy SPA html
run: mv ./src/main/resources/static/index.html ./src/main/resources/templates/spa.html
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
tags: |
type=ref,event=pr,enbled=${{ github.event_name == 'pull_request' }}
type=ref,event=branch,enbled=${{ github.event_name != 'pull_request' }}
type=raw,value=latest,enabled=${{ github.ref_name == 'main' }}
labels: |
org.opencontainers.image.title=${{ github.repository }}
org.opencontainers.image.vendor=${{ github.repository_owner }}
org.opencontainers.image.created=${{ github.event.repository.updated_at }}
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
- uses: docker/build-push-action@v6
id: push
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ github.repository }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
restart-server:
name: Update Server Workflow
needs: build
uses: ./.github/workflows/update-server.yml
secrets: inherit