Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Fix to set context #27

Merged
merged 3 commits into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/staging-apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,22 @@ jobs:

steps:
- uses: "actions/checkout@v4"

- name: Get context directory of Dockerfile
id: dockerfile-context
run: |
echo "context=$(dirname '${{ matrix.dockerfile }}')" >> $GITHUB_OUTPUT
- name: Get microservice name
id: microservice-name
run: |
echo "service-name=$(basename '${{ steps.dockerfile-context.outputs.context }}')" >> $GITHUB_OUTPUT

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/approvers/oreorebot2
ghcr.io/approvers/pulsate/${{ steps.microservice-name.outputs.service-name }}
tags: |
${{ github.sha }}
type=raw,value=latest,enable={{is_default_branch}}
Expand All @@ -55,7 +65,7 @@ jobs:
uses: docker/build-push-action@v5
with:
push: true
file: ${{ matrix.dockerfile }}
context: ${{ steps.dockerfile-context.outputs.context }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down