generated from RyosukeDTomita/template_repository_all
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (29 loc) · 1.18 KB
/
packages.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: push GitHub Container Registry
on:
release:
types: [created]
defaults:
run:
shell: bash
env:
GITHUB_CONTAINER_REGISTRY_TAG: ryosukedtomita/my_portscanner
IMAGE_NAME: my_portscanner
jobs:
create-package:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: checkout repository to runner
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: create docker images
run: docker buildx bake
# imageをgithub container registryにpushする
- name: Log in to GitHub Container Registry
run: echo ${{ secrets.GH_SECRET }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push Docker image to GitHub Container Registry
run: |
docker tag ${{ env.IMAGE_NAME}} ghcr.io/${{ env.GITHUB_CONTAINER_REGISTRY_TAG }}:latest
docker tag ${{ env.IMAGE_NAME}} ghcr.io/${{ env.GITHUB_CONTAINER_REGISTRY_TAG }}:$(docker run my_portscanner --version)
docker push ghcr.io/${{ env.GITHUB_CONTAINER_REGISTRY_TAG }}:latest
docker push ghcr.io/${{ env.GITHUB_CONTAINER_REGISTRY_TAG }}:$(docker run my_portscanner --version)