Node 18, Nuxt 2.17, npm, update deps #81
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: Build CI | |
on: | |
push: | |
branches: [ '*' ] | |
tags: [ 'v*.*.*' ] | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# no need to work on a cache here, it is not faster than pulling | |
# instead work on moving to some images hosted on ghcr.io, it is the fastest | |
- name: Run test dependencies | |
run: | | |
docker compose pull --quiet | |
NO_UI=true docker compose up -d --wait | |
- name: Prepare docker image tags | |
id: docker_meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver-opts: network=host | |
- name: Login to Github container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Prepare BUILD.json | |
run: | | |
echo '{"version": "${{github.ref_name}}", "repository": "${{github.server_url}}/${{github.repository}}", "commit": "${{github.sha}}"}' > BUILD.json | |
cat BUILD.json | |
- name: Build and push docker images | |
id: docker_build | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
platforms: linux/amd64,linux/arm64 | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
allow: network.host | |
network: host | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Stop test dependencies | |
run: docker compose stop | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
- name: Send Keel notification to staging-koumoul.com | |
if: startsWith(github.ref, 'refs/heads/') | |
run: | | |
curl -s --fail --show-error -X POST https://keel.admin.staging-koumoul.com/v1/webhooks/native -u ${{ secrets.KEEL_STAGING_USER }}:${{ secrets.KEEL_STAGING_PASSWORD }} -d '{"name": "ghcr.io/${{ github.repository }}", "tag": "${{ steps.docker_meta.outputs.version }}"}' | |
- name: Send Keel notification to koumoul.com | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
curl -s --fail --show-error -X POST https://keel.admin.koumoul.com/v1/webhooks/native -u ${{ secrets.KEEL_PROD_USER }}:${{ secrets.KEEL_PROD_PASSWORD }} -d '{"name": "ghcr.io/${{ github.repository }}", "tag": "${{ steps.docker_meta.outputs.version }}"}' |