From d9671b3d491b57c702e534fe719226b32d25fff1 Mon Sep 17 00:00:00 2001 From: Irori235 Date: Thu, 14 Mar 2024 20:57:30 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Add=20build=20and=20push=20actio?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..7799d35 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,34 @@ +name: Build and push to ghcr + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + image: + permissions: + contents: read + packages: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Create Tag SHA + id: create-tag-sha + run: | + echo ${{ github.sha }} | cut -c 1-7 | awk '{print "sha="$0}' >> $GITHUB_OUTPUT + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: irori235 + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + ghcr.io/irori235/cashly:latest + ghcr.io/irori235/cashly:${{ steps.create-tag-sha.outputs.sha }}