From a8bad0bb9b607ab7d77b93712d3f6e63b96f64b0 Mon Sep 17 00:00:00 2001 From: holzmaster Date: Fri, 22 Mar 2024 01:27:15 +0100 Subject: [PATCH] Add image build to CI --- .github/workflows/CD.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index ccd04eef..a95d9455 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -14,9 +14,42 @@ on: jobs: + image: + name: Build Container Images + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: "ghcr.io" + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/nulldev/csz-bot + tags: | + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }} + + - uses: docker/build-push-action@v5 + with: + push: true + context: . # https://github.com/docker/build-push-action/issues/182 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64 + deploy: name: Deploy runs-on: ubuntu-latest + needs: image concurrency: production environment: