separate workflow for build vs publish
This commit is contained in:
		
							
								
								
									
										45
									
								
								.gitea/workflows/build-and-publish.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								.gitea/workflows/build-and-publish.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,45 @@ | |||||||
|  |  | ||||||
|  | name: Build and publish container images | ||||||
|  |  | ||||||
|  | on: [ workflow_dispatch ] | ||||||
|  |  | ||||||
|  | jobs: | ||||||
|  |   build-and-publish: | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     container: | ||||||
|  |       image: catthehacker/ubuntu:act-latest | ||||||
|  |     steps: | ||||||
|  |     - name: Check out the repo | ||||||
|  |       uses: actions/checkout@v3 | ||||||
|  |  | ||||||
|  |     - name: Set up QEMU | ||||||
|  |       uses: docker/setup-qemu-action@v2 | ||||||
|  |  | ||||||
|  |     - name: Set up Docker Buildx | ||||||
|  |       uses: docker/setup-buildx-action@v2 | ||||||
|  |  | ||||||
|  |     - name: Log in to the Container registry | ||||||
|  |       uses: docker/login-action@v2 | ||||||
|  |       with: | ||||||
|  |         registry: gitea.jbrumond.me | ||||||
|  |         username: ${{ secrets.REGISTRY_USER }} | ||||||
|  |         password: ${{ secrets.REGISTRY_TOKEN }} | ||||||
|  |  | ||||||
|  |     - name: Build and push | ||||||
|  |       uses: docker/build-push-action@v4 | ||||||
|  |       env: | ||||||
|  |         # see <https://docs.gitea.com/usage/actions/comparison#dockerbuild-push-actionv4> | ||||||
|  |         ACTIONS_RUNTIME_TOKEN: '' | ||||||
|  |       with: | ||||||
|  |         context: . | ||||||
|  |         push: true | ||||||
|  |         tags: | | ||||||
|  |           gitea.jbrumond.me/images/rotate-backups:8 | ||||||
|  |           gitea.jbrumond.me/images/rotate-backups:8.1 | ||||||
|  |         platforms: | | ||||||
|  |           linux/amd64 | ||||||
|  |           linux/arm64 | ||||||
|  |         build_args: | | ||||||
|  |           PYTHON_VERSION=3 | ||||||
|  |           ALPINE_VERSION=3.18 | ||||||
|  |           ROTATE_BACKUPS_VERSION=8.1 | ||||||
| @@ -1,5 +1,5 @@ | |||||||
|  |  | ||||||
| name: Build and publish container images | name: Build container images | ||||||
|  |  | ||||||
| on: | on: | ||||||
|   push: |   push: | ||||||
| @@ -7,7 +7,7 @@ on: | |||||||
|     - master |     - master | ||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|   build-and-publish: |   build: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     container: |     container: | ||||||
|       image: catthehacker/ubuntu:act-latest |       image: catthehacker/ubuntu:act-latest | ||||||
| @@ -21,13 +21,6 @@ jobs: | |||||||
|     - name: Set up Docker Buildx |     - name: Set up Docker Buildx | ||||||
|       uses: docker/setup-buildx-action@v2 |       uses: docker/setup-buildx-action@v2 | ||||||
|  |  | ||||||
|     - name: Log in to the Container registry |  | ||||||
|       uses: docker/login-action@v2 |  | ||||||
|       with: |  | ||||||
|         registry: gitea.jbrumond.me |  | ||||||
|         username: ${{ secrets.REGISTRY_USER }} |  | ||||||
|         password: ${{ secrets.REGISTRY_TOKEN }} |  | ||||||
|  |  | ||||||
|     - name: Build and push |     - name: Build and push | ||||||
|       uses: docker/build-push-action@v4 |       uses: docker/build-push-action@v4 | ||||||
|       env: |       env: | ||||||
| @@ -35,10 +28,11 @@ jobs: | |||||||
|         ACTIONS_RUNTIME_TOKEN: '' |         ACTIONS_RUNTIME_TOKEN: '' | ||||||
|       with: |       with: | ||||||
|         context: . |         context: . | ||||||
|         push: true |         push: false | ||||||
|         tags: | |  | ||||||
|           gitea.jbrumond.me/images/rotate-backups:8 |  | ||||||
|           gitea.jbrumond.me/images/rotate-backups:8.1 |  | ||||||
|         platforms: | |         platforms: | | ||||||
|           linux/amd64 |           linux/amd64 | ||||||
|           linux/arm64 |           linux/arm64 | ||||||
|  |         build_args: | | ||||||
|  |           PYTHON_VERSION=3 | ||||||
|  |           ALPINE_VERSION=3.18 | ||||||
|  |           ROTATE_BACKUPS_VERSION=8.1 | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ FROM python:${PYTHON_VERSION}-alpine${ALPINE_VERSION} | |||||||
| RUN apk update && apk add less | RUN apk update && apk add less | ||||||
|  |  | ||||||
| RUN pip install rotate-backups==8.1 | RUN pip install rotate-backups==8.1 | ||||||
| # RUN pip install rotate-backups==$ROTATE_BACKUPS_VERSION | # RUN pip install rotate-backups==${ROTATE_BACKUPS_VERSION} | ||||||
|  |  | ||||||
| RUN mkdir /data | RUN mkdir /data | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user