diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..429ca1c --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,25 @@ +on: + workflow_dispatch: + push: + tags: + - '*' + +permissions: + contents: read + packages: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: install docker emulation + run: docker run --rm --privileged tonistiigi/binfmt:latest --install amd64,arm64 + - name: Set up buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ghcr.io + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin + - name: Build and push + run: | + docker buildx build --platform linux/amd64,linux/arm64 -t $(echo 'ghcr.io/${{ github.repository }}/slack-notify:${{ github.ref_name }}' | tr '[:upper:]' '[:lower:]') --push .