From 7e8b9b735f322643f5ecd0becb2a6030c309b5bb Mon Sep 17 00:00:00 2001 From: Tim Coombs Date: Mon, 15 Apr 2024 21:49:58 +1000 Subject: [PATCH] feat: github actions build --- .github/workflows/build.yml | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..cfc70ea --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,53 @@ +name: ci + +on: + push: + branch: + - main + tags: + - 'v*' + +jobs: + docker: + runs-on: docker + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + platforms: linux/amd64, linux/arm64/v8 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: | + sunaurus/lemmy-ui-next + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Login to Github Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Checkout + uses: actions/checkout@v3 + + - name: Build and push + uses: docker/build-push-action@v4 + env: + ACTIONS_RUNTIME_TOKEN: '' + with: + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}