checkoutv4 and github_token #140
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
# This workflow creates docker images that are then used for: | |
# | |
# - DIRAC distribution (create DIRAC release tarballs) | |
# - running DIRAC integration tests in GitHub actions (slc6+cc7+c8) | |
# | |
# All created images are then uploaded to GitHub packages and docker hub | |
name: Create images | |
on: push | |
# on: | |
# schedule: | |
# # every Sunday | |
# - cron: '0 0 * * 0' | |
jobs: | |
# Image for running dirac-distribution | |
dirac-distribution: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build | |
run: | | |
echo $PWD | |
ls -l | |
docker build -t dirac-distribution dirac-distribution/ | |
- name: tag | |
run: | | |
docker tag dirac-distribution diracgrid/dirac-distribution:latest | |
docker tag dirac-distribution ghcr.io/diracgrid/management/dirac-distribution:latest | |
- name: show | |
run: docker images | |
- name: login and push | |
env: | |
deploy_secret: ${{ secrets.DOCKER_HUB_USERNAME }} | |
run: | | |
if [ ! -z ${deploy_secret} ]; then | |
echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login --username ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin; | |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
docker push diracgrid/dirac-distribution:latest; | |
docker push ghcr.io/diracgrid/management/dirac-distribution:latest; | |
else | |
echo "Skipping deploy no secrets present"; | |
fi | |
# Now the images for running integration tests | |
docker-compose-dirac: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build | |
run: docker build -t docker-compose-dirac docker-compose-dirac/ | |
- name: tag | |
run: | | |
docker tag docker-compose-dirac diracgrid/docker-compose-dirac:latest | |
docker tag docker-compose-dirac ghcr.io/diracgrid/management/docker-compose-dirac:latest | |
- name: show | |
run: docker images | |
- name: login and push | |
env: | |
deploy_secret: ${{ secrets.DOCKER_HUB_USERNAME }} | |
run: | | |
if [ ! -z ${deploy_secret} ]; then | |
echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login --username ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin; | |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
docker push diracgrid/docker-compose-dirac:latest; | |
docker push ghcr.io/diracgrid/management/docker-compose-dirac:latest; | |
else | |
echo "Skipping deploy no secrets present"; | |
fi | |
el9-dirac: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build | |
run: docker build -t el9-dirac el9-dirac/ | |
- name: tag | |
run: | | |
docker tag el9-dirac diracgrid/el9-dirac:latest | |
docker tag el9-dirac ghcr.io/diracgrid/management/el9-dirac:latest | |
- name: show | |
run: docker images | |
- name: login and push | |
env: | |
deploy_secret: ${{ secrets.DOCKER_HUB_USERNAME }} | |
run: | | |
if [ ! -z ${deploy_secret} ]; then | |
echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login --username ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin; | |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
docker push diracgrid/el9-dirac:latest; | |
docker push ghcr.io/diracgrid/management/el9-dirac:latest; | |
else | |
echo "Skipping deploy no secrets present"; | |
fi | |
c8-dirac: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build | |
run: docker build -t c8-dirac c8-dirac/ | |
- name: tag | |
run: | | |
docker tag c8-dirac diracgrid/c8-dirac:latest | |
docker tag c8-dirac ghcr.io/diracgrid/management/c8-dirac:latest | |
- name: show | |
run: docker images | |
- name: login and push | |
env: | |
deploy_secret: ${{ secrets.DOCKER_HUB_USERNAME }} | |
run: | | |
if [ ! -z ${deploy_secret} ]; then | |
echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login --username ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin; | |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
docker push diracgrid/c8-dirac:latest; | |
docker push ghcr.io/diracgrid/management/c8-dirac:latest; | |
else | |
echo "Skipping deploy no secrets present"; | |
fi | |
cc7-dirac: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build | |
run: docker build -t cc7-dirac cc7-dirac/ | |
- name: tag | |
run: | | |
docker tag cc7-dirac diracgrid/cc7-dirac:latest | |
docker tag cc7-dirac ghcr.io/diracgrid/management/cc7-dirac:latest | |
- name: show | |
run: docker images | |
- name: login and push | |
env: | |
deploy_secret: ${{ secrets.DOCKER_HUB_USERNAME }} | |
run: | | |
if [ ! -z ${deploy_secret} ]; then | |
echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login --username ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin; | |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
docker push diracgrid/cc7-dirac:latest; | |
docker push ghcr.io/diracgrid/management/cc7-dirac:latest; | |
else | |
echo "Skipping deploy no secrets present"; | |
fi | |
# Image for deploying config files to CVMFS (GridFTP) | |
dirac-cvmfs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build | |
run: | | |
echo $PWD | |
ls -l | |
docker build -t dirac-cvmfs dirac-cvmfs/ | |
- name: tag | |
run: | | |
docker tag dirac-cvmfs diracgrid/dirac-cvmfs:latest | |
docker tag dirac-cvmfs ghcr.io/diracgrid/management/dirac-cvmfs:latest | |
- name: show | |
run: docker images | |
- name: login and push | |
env: | |
deploy_secret: ${{ secrets.DOCKER_HUB_USERNAME }} | |
run: | | |
if [ ! -z ${deploy_secret} ]; then | |
echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login --username ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin; | |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
docker push diracgrid/dirac-cvmfs:latest; | |
docker push ghcr.io/diracgrid/management/dirac-cvmfs:latest; | |
else | |
echo "Skipping deploy no secrets present"; | |
fi | |
# Image for building DIRAOS | |
centos6: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build | |
run: | | |
echo $PWD | |
ls -l | |
docker build -t centos6 centos6/ | |
- name: tag | |
run: | | |
docker tag centos6 diracgrid/centos6:latest | |
docker tag centos6 ghcr.io/diracgrid/management/centos6:latest | |
- name: show | |
run: docker images | |
- name: login and push | |
env: | |
deploy_secret: ${{ secrets.DOCKER_HUB_USERNAME }} | |
run: | | |
if [ ! -z ${deploy_secret} ]; then | |
echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login --username ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin; | |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
docker push diracgrid/centos6:latest; | |
docker push ghcr.io/diracgrid/management/centos6:latest; | |
else | |
echo "Skipping deploy no secrets present"; | |
fi |