-
Notifications
You must be signed in to change notification settings - Fork 45
126 lines (117 loc) · 4.34 KB
/
dispatch_container_upload.yml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Dispatch push containers to registries
on:
workflow_dispatch:
inputs:
container_name:
description: Name of container to rebuild
required: true
jobs:
push_docker_containers:
runs-on: ubuntu-latest
strategy:
fail-fast: false
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup up docker buildx
uses: docker/setup-buildx-action@v2
- name: Log in to ghcr.io with docker
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{github.repository_owner}}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to quay.io with docker
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ vars.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_TOKEN }}
- name: Log in to docker.io with docker
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ vars.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_TOKEN }}
- name: Build and push docker containers
uses: docker/build-push-action@v4
with:
context: container/${{ github.event.inputs.container_name }}
file: .github/docker.df
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ github.event.inputs.container_name }}_docker:latest
quay.io/${{ vars.QUAYIO_USERNAME }}/${{ github.event.inputs.container_name }}_docker:latest
docker.io/${{ vars.DOCKERIO_USERNAME }}/${{ github.event.inputs.container_name }}_docker:latest
# push_apptainer_containers:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# permissions:
# contents: read
# packages: write
#
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - name: Setup micromamba
# uses: mamba-org/setup-micromamba@v1
# with:
# environment-name: containers
# create-args: apptainer
# generate-run-shell: true
#
# - name: Build apptainer containers
# shell: micromamba-shell {0}
# run: |
# pushd container/${{ github.event.inputs.container_name }}; \
# apptainer build /tmp/${{ github.event.inputs.container_name }}_apptainer.sif ${{ github.workspace }}/.github/apptainer.def; \
# popd
#
# - name: Log in to ghcr.io with apptainer
# shell: micromamba-shell {0}
# run: |
# apptainer remote login --username ${{ github.repository_owner }} \
# --password ${{ secrets.GITHUB_TOKEN }} \
# docker://ghcr.io/${{ github.repository_owner }}
#
# - name: Push apptainer containers to ghcr.io
# shell: micromamba-shell {0}
# run: |
# apptainer push \
# /tmp/${{ github.event.inputs.container_name }}_apptainer.sif \
# oras://ghcr.io/${{ github.repository_owner }}/${{ github.event.inputs.container_name }}_apptainer:latest
#
# - name: Log in to quay.io with apptainer
# shell: micromamba-shell {0}
# run: |
# apptainer remote login --username ${{ vars.QUAYIO_USERNAME }} \
# --password ${{ secrets.QUAYIO_TOKEN }} \
# docker://quay.io/${{ vars.QUAYIO_USERNAME }}
#
# - name: Push apptainer containers to quay.io
# shell: micromamba-shell {0}
# run: |
# apptainer push \
# /tmp/${{ github.event.inputs.container_name }}_apptainer.sif \
# oras://quay.io/${{ vars.QUAYIO_USERNAME }}/${{ github.event.inputs.container_name }}_apptainer:latest
#
# - name: Log in to docker.io with apptainer
# shell: micromamba-shell {0}
# run: |
# apptainer remote login --username ${{ vars.DOCKERIO_USERNAME }} \
# --password ${{ secrets.DOCKERIO_TOKEN }} \
# docker://docker.io
#
# - name: Push apptainer containers to docker.io
# shell: micromamba-shell {0}
# run: |
# apptainer push \
# /tmp/${{ github.event.inputs.container_name }}_apptainer.sif \
# oras://docker.io/${{ vars.DOCKERIO_USERNAME }}/${{ github.event.inputs.container_name }}_apptainer:latest