From 533928da8aece05b382cd67a88728084f5579262 Mon Sep 17 00:00:00 2001 From: JuLi0n21 Date: Sun, 1 Mar 2026 20:02:01 +0100 Subject: [PATCH] add workflow to create img on push --- .github/workflows/docker-build.yml | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..a918257 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,37 @@ +name: Build Astro Image + +on: + push: + branches: [ "master" ] + +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: Get Short SHA + id: vars + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Build and Export to Docker + uses: docker/build-push-action@v5 + with: + context: . + load: false + tags: | + astro:latest + astro:${{ steps.vars.outputs.sha_short }} + outputs: type=docker,dest=/tmp/astro-image.tar + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: astro-docker-${{ steps.vars.outputs.sha_short }} + path: /tmp/astro-image.tar + retention-days: 7