From f186f61beb7415eb18a70c3b567bc6946e769699 Mon Sep 17 00:00:00 2001 From: Tnix Date: Tue, 13 Aug 2024 21:33:30 +1200 Subject: [PATCH] Create publish-latest-ghcr.yml --- .github/workflows/publish-latest-ghcr.yml | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/publish-latest-ghcr.yml diff --git a/.github/workflows/publish-latest-ghcr.yml b/.github/workflows/publish-latest-ghcr.yml new file mode 100644 index 0000000..9416e03 --- /dev/null +++ b/.github/workflows/publish-latest-ghcr.yml @@ -0,0 +1,24 @@ +name: Publish latest to GHCR.io + +on: + push: + branches: [ "main" ] + +jobs: + + build: + 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 GHCR.io + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin + + - name: Build and push images + run: | + IMAGE_NAME=ghcr.io/${{ github.repository }} + docker buildx build --push -t $IMAGE_NAME:latest .