From e16e8156629e43aafe5e875326e94a247ca0b41e Mon Sep 17 00:00:00 2001 From: Bill Maxwell Date: Thu, 18 Jan 2024 10:22:07 -0700 Subject: [PATCH] add github action Signed-off-by: Bill Maxwell --- .github/workflows/publish.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..3b5d632 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,34 @@ +name: Publish Acorn image +on: + push: + tags: + - "v[0-9]*" + +jobs: + publish: + name: Publish + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: acorn-io/actions-setup@v2 + with: + acorn-version: "main" + - name: Login to GHCR + uses: acorn-io/actions-login@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and Publish Acorn image + run: | + TAG=${GITHUB_REF#refs/*/} + USER=${{ github.repository_owner }} + REPO=${{ github.event.repository.name }} + acorn build --platform linux/amd64 --push -t ghcr.io/$USER/$REPO:$TAG . + acorn build --platform linux/amd64 --push -t ghcr.io/$USER/$REPO/examples:$TAG examples