chore(deps): update dependency eslint-config-next to v15 #272
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build and push Docker images | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get short SHA | |
run: echo "SHORT_SHA=$(cut -c 1-7 <<< ${{ github.sha }})" >> "$GITHUB_ENV" | |
- name: Get Docker Metadata | |
id: docker_meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
tags: | | |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | |
type=raw,value=sha-${{ env.SHORT_SHA }},enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | |
type=raw,value=dev-${{ github.ref_name }},enable=${{ github.ref != format('refs/heads/{0}', 'main') }} | |
type=raw,value=dev-sha-${{ env.SHORT_SHA }},enable=${{ github.ref != format('refs/heads/{0}', 'main') }} | |
labels: | | |
org.opencontainers.image.version=dev-${{ github.ref_name }},enable=${{ github.ref != format('refs/heads/{0}', 'main') }} | |
org.opencontainers.image.version=${{ env.SHORT_SHA }},enable=${{ github.ref != format('refs/heads/{0}', 'main') }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
- name: Comment on PR | |
if: github.event_name == 'pull_request' | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: `## Your image has been built and pushed to GitHub Container Registry.\n\nYou can pull it using the following tags:\n\n\`\`\`bash\n${{ steps.docker_meta.outputs.tags }}\n\`\`\`\nAlternatively, you can pull it using the following command:\n\n\`\`\`bash\ndocker pull ghcr.io/${{ github.repository }}:dev-sha-${{ env.SHORT_SHA }}\n\`\`\`` | |
}) |