Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(ci): fix CI build by specifying correct Yarn version #95

fix(ci): fix CI build by specifying correct Yarn version

fix(ci): fix CI build by specifying correct Yarn version #95

Workflow file for this run

name: Docker Image CI
on:
push:
tags:
- v*
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
test:
runs-on: ubuntu-latest
services:
testdb:
image: postgres:17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: chmod +x bin/* && sed -i "s/\r$//g" bin/* && sed -i 's/ruby\.exe$/ruby/' bin/*
- name: "Create test database"
env:
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: >-
bin/rake parallel:create
&& bin/rake parallel:migrate
&& bin/rake parallel:prepare
- name: "Run tests"
env:
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: bin/rake parallel:test
generate-vi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate mk2.vi
run: sh ./mkvi.sh
shell: sh
- name: Upload vi artifact
uses: actions/upload-artifact@v4
with:
name: mk2.vi
path: mk2.vi
overwrite: true
build-push-debian:
needs:
- generate-vi
- test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Download vi
uses: actions/download-artifact@v4
with:
name: mk2.vi
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
tags: |
type=semver,enable=true,pattern={{raw}}
type=semver,enable=true,pattern={{raw}},suffix=-mri
type=sha,enable=true,prefix=sha-,suffix=
type=sha,enable=true,prefix=sha-,suffix=-mri
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image (MRI)
id: push-mri
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation (MRI)
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push-mri.outputs.digest }}
push-to-registry: true
build-push-debian-truffle:
needs:
- generate-vi
- test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Download vi
uses: actions/download-artifact@v4
with:
name: mk2.vi
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
tags: |
type=semver,enable=true,pattern={{raw}},suffix=-truffle
type=sha,enable=true,prefix=sha-,suffix=-truffle
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image (Truffle)
id: push-truffle
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: truffle.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation (Truffle)
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push-truffle.outputs.digest }}
push-to-registry: true