forked from CRG-CNAG/docker-centos-perlbrew
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding different runner for each branch
- Loading branch information
Showing
2 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Publish Docker images | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * 6' | ||
env: | ||
DOCKER_IMAGE_PREFIX: amazonlinux-perlbrew | ||
jobs: | ||
push_to_registries: | ||
name: Push Docker image to multiple registries | ||
runs-on: ubuntu-latest | ||
# runs-on: | ||
# group: perlbrew | ||
permissions: | ||
packages: write | ||
contents: read | ||
strategy: | ||
fail-fast: true | ||
max-parallel: 1 | ||
matrix: | ||
branch: ['2023'] | ||
folder: ['base', 'pyenv', 'pyenv3', 'pyenv23', 'pyenv-java', 'pyenv3-java', 'pyenv23-java'] | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ matrix.branch }} | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Tune QEMU | ||
run: | | ||
docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-* && docker run --privileged --rm tonistiigi/binfmt --install all | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Log in to GitHub Docker Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Sets env vars for Docker image | ||
run: | | ||
echo "DOCKER_IMAGE_TAG=${{env.DOCKER_IMAGE_PREFIX}}" >> $GITHUB_ENV | ||
if: ${{ matrix.folder == 'base' }} | ||
- name: Sets env vars for Docker image | ||
run: | | ||
echo "DOCKER_IMAGE_TAG=${{env.DOCKER_IMAGE_PREFIX}}-${{ matrix.folder }}" >> $GITHUB_ENV | ||
if: ${{ matrix.folder != 'base' }} | ||
- name: Sets env vars for Docker image | ||
run: | | ||
echo "DOCKER_IMAGE_BRANCH=latest" >> $GITHUB_ENV | ||
if: ${{ matrix.branch == 'main' }} | ||
- name: Sets env vars for Docker image | ||
run: | | ||
echo "DOCKER_IMAGE_BRANCH=${{ matrix.branch }}" >> $GITHUB_ENV | ||
if: ${{ matrix.branch != 'main' }} | ||
- name: Push Docker | ||
uses: docker/build-push-action@v6 | ||
with: | ||
file: ./${{ matrix.folder }}/Dockerfile | ||
context: ./${{ matrix.folder }} | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: | | ||
${{ secrets.DOCKERHUB_ACCOUNT }}/${{env.DOCKER_IMAGE_TAG}}:${{ env.DOCKER_IMAGE_BRANCH }} | ||
ghcr.io/${{ github.repository_owner }}/${{env.DOCKER_IMAGE_TAG}}:${{ env.DOCKER_IMAGE_BRANCH }} |
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