Skip to content

v1.2.0

v1.2.0 #1

Workflow file for this run

name: Publish image to GHCR
on:
release:
types: [created]
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- name: Get code access
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
run: echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u yashkathe --password-stdin
- name: Extract version number
id: extract_version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Build and push the image
run: |
docker build . --tag ghcr.io/yashkathe/f1-api-node:${{ env.RELEASE_VERSION }}
docker push ghcr.io/yashkathe/f1-api-node:${{ env.RELEASE_VERSION }}
docker tag ghcr.io/yashkathe/f1-api-node:${{ env.RELEASE_VERSION }} ghcr.io/yashkathe/f1-api-node:latest
docker push ghcr.io/yashkathe/f1-api-node:latest