From 90993b6478510bcd6cc5f682cbfb3178f539222d Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Mon, 13 May 2024 18:54:44 +0100 Subject: [PATCH] Add custom Pydis build workflow --- .github/workflows/main.yaml | 4 +-- .github/workflows/pydis_build.yaml | 42 ++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pydis_build.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e805c56..1bb2d64 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -16,5 +16,5 @@ jobs: uses: ./.github/workflows/test.yaml vuln: uses: ./.github/workflows/vuln.yaml - build-push: - uses: ./.github/workflows/build.yaml + # build-push: + # uses: ./.github/workflows/build.yaml diff --git a/.github/workflows/pydis_build.yaml b/.github/workflows/pydis_build.yaml new file mode 100644 index 0000000..2bd8a30 --- /dev/null +++ b/.github/workflows/pydis_build.yaml @@ -0,0 +1,42 @@ +name: PyDis build & deploy + +on: + push: + branches: ["deployment"] + +jobs: + build-image: + name: Build & push additional images + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Github Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Generate docker image metadata + uses: docker/metadata-action@v5 + id: meta + with: + images: ghcr.io/python-discord/pinnwand + tags: | + type=ref,event=tag,suffix=psql + type=raw,value=latest-psql + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Containerfile + target: psql + cache-from: type=registry,ref=ghcr.io/python-discord/pinnwand:latest-psql + cache-to: type=inline + tags: ${{ steps.meta.outputs.tags }}