-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.28 KB
/
actions.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
38
39
40
41
42
43
44
45
46
47
48
49
name: Build netomox-exp image
on: push
env:
IMAGE_NAME: netomox-exp
jobs:
build_and_push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
secrets: |
"ghp_credential=${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }}"
delete_old_container_images:
needs: build_and_push
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Delete old container images
uses: actions/delete-package-versions@v4
with:
package-name: ${{ env.IMAGE_NAME }}
package-type: 'container'
min-versions-to-keep: 10
delete-only-untagged-versions: 'true'