This repository has been archived by the owner on Jul 11, 2024. It is now read-only.
Update README.md for archival #11
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: Docker Image CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.1.7 | |
- name: Install jq | |
run: sudo apt-get install -y jq | |
- name: Extract version | |
id: get_version | |
run: echo "VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3.3.0 | |
- name: Log in to GHCR | |
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Build and push | |
run: | | |
IMAGE_NAME=ghcr.io/shahzaib-m/sylvre-webapp | |
VERSION=${{ env.VERSION }} | |
docker build -t $IMAGE_NAME:$VERSION -t $IMAGE_NAME:latest . | |
docker push $IMAGE_NAME:$VERSION | |
docker push $IMAGE_NAME:latest |