Skip to content

v0.4.0-beta.0

v0.4.0-beta.0 #23

Workflow file for this run

name: Deploy
on:
release:
types: [prereleased, released]
concurrency:
cancel-in-progress: false

Check failure on line 8 in .github/workflows/cd.yml

View workflow run for this annotation

GitHub Actions / Deploy

Invalid workflow file

The workflow is not valid. .github/workflows/cd.yml (Line: 8, Col: 3): Required property is missing: group .github/workflows/cd.yml (Line: 17, Col: 18): Unrecognized named-value: 'env'. Located at position 1 within expression: env.ENVIRONMENT
env:
ENVIRONMENT: ${{ github.event.action == 'prereleased' && 'staging' || 'production' }}
jobs:
build-and-push:
name: "Build and push docker image"
runs-on: ubuntu-latest
environment: ${{ env.ENVIRONMENT }}
steps:
- name: Print variables
run: echo "${{ toJSON(vars)}}"
- name: Print env
run: echo "${{ toJSON(env)}}"
- name: Print secrets
run: echo "${{ toJSON(secrets)}}"
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker image (environment)
run: |
docker build -t ghcr.io/killmenot/github-test-${{ env.ENVIRONMENT }}:${{ github.event.release.tag_name }} -f Dockerfile .
- name: Push docker image to GitHub Container Registry (environment)
run: |
docker push ghcr.io/killmenot/github-test-${{ env.ENVIRONMENT }}:${{ github.event.release.tag_name }}
- name: Push docker image to GitHub Container Registry (production > staging)
if: env.ENVIRONMENT == 'production'
run: |
docker push ghcr.io/killmenot/github-test-staging:${{ github.event.release.tag_name }}