diff --git a/.github/workflows/release-container.yaml b/.github/workflows/release-container.yaml new file mode 100644 index 000000000..28cd4122a --- /dev/null +++ b/.github/workflows/release-container.yaml @@ -0,0 +1,44 @@ +# ref: https://github.com/marketplace/actions/build-and-push-docker-images + +name: Release container image + +on: + release: + types: [published] + +jobs: + context: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + push: true + + registry: ghcr.io + organization: "${{ github.event.repository.owner.login }}" + repository: "${{ github.event.repository.name }}" + + platforms: | + linux/amd64 + linux/arm64 + + tags: | + latest + ${{ github.event.release.tag_name }} diff --git a/.github/workflows/testing-container.yaml b/.github/workflows/testing-container.yaml new file mode 100644 index 000000000..6d43f996a --- /dev/null +++ b/.github/workflows/testing-container.yaml @@ -0,0 +1,45 @@ +# ref: https://docs.github.com/en/actions/publishing-packages/publishing-docker-images + +name: Testing container image + +on: + push: + branches: + - 'develop' + +jobs: + context: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + push: true + + registry: ghcr.io + organization: "${{ github.event.repository.owner.login }}" + repository: "${{ github.event.repository.name }}" + + platforms: | + linux/amd64 + linux/arm64 + + tags: | + develop + ${{ github.sha }}