diff --git a/.forgejo/workflows/docker-publish.yml b/.forgejo/workflows/docker-publish.yml index 253e05e..44d6afd 100644 --- a/.forgejo/workflows/docker-publish.yml +++ b/.forgejo/workflows/docker-publish.yml @@ -1,67 +1,70 @@ name: CI on: - push: - tags: - - 'v*' - pull_request: + push: + tags: + - "v*" + pull_request: jobs: - audit-test-build: - runs-on: ubuntu-latest - container: oven/bun:1 - steps: - - name: Checkout - uses: actions/checkout@v4 + audit-test-build: + runs-on: ubuntu-latest + container: oven/bun:1 + steps: + - name: Install git + run: apt-get update && apt-get install -y git - - name: Install dependencies - run: bun install --frozen-lockfile + - name: Checkout + uses: actions/checkout@v4 - - name: Audit dependencies - run: bun audit + - name: Install dependencies + run: bun install --frozen-lockfile - - name: Run unit tests - run: bun run test:unit run + - name: Audit dependencies + run: bun audit - - name: Build - run: bun run build + - name: Run unit tests + run: bun run test:unit run - - name: Upload dist - uses: actions/upload-artifact@v4 - with: - name: dist - path: dist + - name: Build + run: bun run build - publish: - needs: audit-test-build - if: startsWith(github.ref, 'refs/tags/v') - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Upload dist + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist - - name: Download dist - uses: actions/download-artifact@v4 - with: - name: dist - path: dist + publish: + needs: audit-test-build + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 - - name: Log in to registry - uses: docker/login-action@v3 - with: - registry: git.mcpeakdev.com - username: ${{ github.actor }} - password: ${{ secrets.REGISTRY_TOKEN }} + - name: Download dist + uses: actions/download-artifact@v4 + with: + name: dist + path: dist - - name: Extract image tag - id: meta - run: echo "tag=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" + - name: Log in to registry + uses: docker/login-action@v3 + with: + registry: git.mcpeakdev.com + username: ${{ github.actor }} + password: ${{ secrets.REGISTRY_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: | - git.mcpeakdev.com/mcpeakml/portfolio:${{ steps.meta.outputs.tag }} - git.mcpeakdev.com/mcpeakml/portfolio:latest + - name: Extract image tag + id: meta + run: echo "tag=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: | + git.mcpeakdev.com/mcpeakml/portfolio:${{ steps.meta.outputs.tag }} + git.mcpeakdev.com/mcpeakml/portfolio:latest