Skip to content

Pin Alpine version

Pin Alpine version #32

Workflow file for this run

name: PR
on:
pull_request:
branches:
- main
jobs:
docker-build-push:
strategy:
matrix:
images: [eq-k8s-helm-deploy-image, eq-terraform-deploy-image, eq-python-deploy-image, eq-tinyproxy-image]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set Tag and SHA
run: |
CLEAN_TAG=$(echo "${{ github.event.pull_request.head.ref }}" | tr / -)
echo "TAG=$CLEAN_TAG" >> $GITHUB_ENV
echo "SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
- name: Build
run: >
docker build -t onsdigital/${{ matrix.images }}:$TAG
-t ${{ secrets.GAR_LOCATION }}/${{ secrets.GAR_PROJECT_ID }}/docker-images/${{ matrix.images }}:$TAG -f ${{ matrix.images }}/Dockerfile .
- name: Push to Docker Hub
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
echo "Pushing to DockerHub with tag $TAG"
docker push onsdigital/${{ matrix.images }}:$TAG
- name: Push to GAR
env:
GAR_SERVICE_KEY: ${{ secrets.GAR_SERVICE_KEY }}
run: |
echo $GAR_SERVICE_KEY | docker login -u _json_key --password-stdin https://${{ secrets.GAR_LOCATION }}
gcloud auth configure-docker ${{ secrets.GAR_LOCATION }}
echo "Pushing to GAR with tag $TAG"
docker push ${{ secrets.GAR_LOCATION }}/${{ secrets.GAR_PROJECT_ID }}/docker-images/${{ matrix.images }}:$TAG