Skip to content

Merge pull request #1 from sai80082/feat-docker #11

Merge pull request #1 from sai80082/feat-docker

Merge pull request #1 from sai80082/feat-docker #11

Workflow file for this run

name: Docker Release
# on:
# push:
# tags:
# - "v*"
on:
push:
branches:

Check failure on line 10 in .github/workflows/docker-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/docker-release.yml

Invalid workflow file

You have an error in your yaml syntax on line 10
- feat-docker
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Extract version from package.json
id: extract_version
run: |
VERSION=$(jq -r '.version' package.json)
echo "Version extracted: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build and push Docker image
run: |
docker build --build-arg VERSION=${{ env.VERSION }} \
-t ghcr.io/${{ github.repository }}:${{ env.VERSION }} \
-t ghcr.io/${{ github.repository }}:latest .
docker push ghcr.io/${{ github.repository }}:latest
docker push ghcr.io/${{ github.repository }}:${{ env.VERSION }}