chore(deps): update ghcr.io/envelope-zero/backend docker tag to v4.2.2 #4763
Workflow file for this run
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: Test, build and push | |
on: | |
push: | |
# Always run on main so that the cached dependencies are up to date | |
# PRs can access caches created by the default branch, but if we do | |
# not create the cache on the default branch, PRs would allways create | |
# a new one, which defeats the purpose. | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
# Enables us to manually trigger the CI for earlier tags | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: read | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- name: Cache dependencies | |
uses: actions/setup-node@v4.0.1 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
- name: set npm auth | |
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc | |
- name: install node modules | |
run: npm ci | |
- uses: pre-commit/action@v3.0.0 | |
cypress: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: read | |
# Current backend version as service container | |
services: | |
backend: | |
image: ghcr.io/envelope-zero/backend:v4.2.2 | |
env: | |
CORS_ALLOW_ORIGINS: http://localhost:3000 | |
API_URL: http://localhost:3000/api | |
ports: | |
- 8080:8080 | |
options: --user root | |
strategy: | |
fail-fast: false # https://github.com/cypress-io/github-action/issues/48 | |
matrix: | |
containers: [1, 2, 3, 4, 5, 6] # Use 6 parallel instances as per Cypress Cloud recommendation | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
- name: Set npm auth | |
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc | |
- name: Run cypress | |
uses: cypress-io/github-action@v6.6.0 | |
with: | |
start: npm run start-ci | |
# Frontend runs on :3000, API on :8080 | |
wait-on: 'http://localhost:3000, http://localhost:8080' | |
browser: chromium | |
headed: true | |
# Records to Cypress Cloud | |
record: true | |
parallel: true | |
env: | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-and-push-image: | |
needs: | |
- pre-commit | |
- cypress | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4.1.1 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3.0.0 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5.5.0 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5.1.0 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.repository_owner == 'envelope-zero' && contains(github.ref, 'refs/tags/') }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
VITE_VERSION=${{ github.ref_name }} | |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} |