Merge pull request #61 from RyosukeDTomita/feature/github-pages #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: push GitHub Container Registry | |
on: | |
push: | |
branches: | |
- master | |
# - feature/github-pages | |
# release: | |
# types: [created] | |
defaults: | |
run: | |
shell: bash | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ryosukedtomita/devsecops-demo-aws-ecs | |
jobs: | |
create-package: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: checkout repository to runner | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GH_SECRET_PACKAGE }} # write packages and repo | |
- name: Build and push | |
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0 | |
with: | |
context: . | |
push: true | |
tags: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:latest" | |
cache-from: type=registry,mode=max,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
cache-to: type=registry,mode=max,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |