chore(deps): bump nanoid from 3.3.7 to 3.3.8 #491
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: Docker | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
schedule: | |
- cron: '0 0 1 * *' # At 00:00 on day-of-month 1. | |
workflow_dispatch: | |
concurrency: | |
group: Docker ${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
registry: ghcr.io | |
jobs: | |
docker-run: | |
runs-on: ubuntu-latest | |
name: Docker build developpment | |
strategy: | |
fail-fast: false | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.registry }}/${{ github.repository }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.registry }} | |
username: ${{ secrets.CR_USER }} | |
password: ${{ secrets.CR_PAT }} | |
- name: Get version | |
id: version | |
run: | | |
echo "release=$(git describe --abbrev=0 --tags --exact-match $GITHUB_SHA 2>/dev/null || git log --pretty="%h" -n1 $GITHUB_SHA)" >> $GITHUB_OUTPUT | |
# Build docker | |
- name: Docker build | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
cache-from: type=registry,ref=${{ env.registry }}/${{ github.repository }}:main | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
file: Dockerfile | |
context: . | |
build-args: | |
SENTRY_RELEASE=${{ steps.version.outputs.release }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
- name: Generate artifact attestation | |
uses: actions/attest-build-provenance@v1 | |
if: ${{ github.event_name != 'pull_request' }} | |
with: | |
subject-name: ${{ env.registry }}/${{ github.repository }} | |
subject-digest: ${{ steps.docker_build.outputs.digest }} | |
push-to-registry: true | |
deploy: | |
runs-on: ubuntu-latest | |
name: Deploy on staging | |
needs: docker-run | |
if: github.event_name != 'pull_request' | |
environment: staging | |
steps: | |
- name: Post request | |
run: | | |
curl -sSL -u ":$TOKEN" -X POST -H "Content-type: application/json" "$URL" -d "$PAYLOAD" | |
env: | |
URL: ${{ secrets.URL }} | |
PAYLOAD: ${{ secrets.PAYLOAD }} | |
TOKEN: ${{ secrets.TOKEN }} |