Skip to content

fix: appending ghcr.io to tag names #11

fix: appending ghcr.io to tag names

fix: appending ghcr.io to tag names #11

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]
with:
path: server/package.json
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag velib-rest:latest
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
id: push
uses: docker/[email protected]
with:
context: .
push: true
tags: ghcr.io/benbaja/velib-rest:latest,ghcr.io/benbaja/velib-rest:v${{ steps.package-version.outputs.current-version }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true