Skip to content

added trigger to GH workflows. updated YAML #7

added trigger to GH workflows. updated YAML

added trigger to GH workflows. updated YAML #7

name: package-store-admin
on:
push:
branches:
- 'main'
paths:
- 'store-admin/**'
on:

Check failure on line 10 in .github/workflows/package-store-back-service.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/package-store-back-service.yaml

Invalid workflow file

You have an error in your yaml syntax on line 10
workflow_dispatch:
jobs:
set-env:
name: Set Environment Variables
runs-on: ubuntu-latest
outputs:
version: ${{ steps.main.outputs.version }}
created: ${{ steps.main.outputs.created }}
project: ${{ steps.main.outputs.project }}
image: ${{ steps.main.outputs.image }}
repository: ${{ steps.main.outputs.repository }}
steps:
- id: main
run: |
echo ::set-output name=version::$(echo ${GITHUB_SHA} | cut -c1-7)
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=project::store-admin
echo ::set-output name=image::store-admin
echo ::set-output name=repository::ghcr.io/azure-samples/aks-store-demo
package-service:
name: Package Service
runs-on: ubuntu-latest
needs: set-env
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.CR_PAT }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: src/store-admin
file: src/store-admin/Dockerfile
push: true
tags: |
${{ needs.set-env.outputs.repository }}/${{ needs.set-env.outputs.image }}:latest
${{ needs.set-env.outputs.repository }}/${{ needs.set-env.outputs.image }}:${{ needs.set-env.outputs.version }}
labels: |
org.opencontainers.image.source=${{ github.repositoryUrl }}
org.opencontainers.image.created=${{ needs.set-env.outputs.created }}
org.opencontainers.image.revision=${{ needs.set-env.outputs.version }}