Skip to content

Commit

Permalink
Merge pull request #59 from nanasess/push-docker-image
Browse files Browse the repository at this point in the history
Push docker image to GitHub Container Registry
  • Loading branch information
nanasess authored Sep 15, 2022
2 parents e90a7f9 + 834ff71 commit 933b44a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/dockerbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ on:
- 'dockerbuild/*'
- 'docker-compose*.yml'
- '.github/workflows/dockerbuild.yml'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
dockerbuild:
name: dockerbuild
runs-on: ${{ matrix.operating-system }}
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -96,6 +102,27 @@ jobs:
run: |
echo "APP_ENV=${APP_ENV}" > .env
vendor/bin/codecept -vvv run acceptance --env chrome,github_action_docker -g ${GROUP}
## see https://docs.github.com/ja/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#publishing-a-package-using-an-action
- name: Login to GitHub Container Registry
if: success()
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
if: success()
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Upload evidence
if: failure()
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 933b44a

Please sign in to comment.