diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 86ae082..34c63f4 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -10,21 +10,19 @@ on: workflow_dispatch: {} env: + DOCKER_REGISTRY: 821090935708.dkr.ecr.eu-west-1.amazonaws.com SPINNAKER_URL: https://spinnaker-gate.shared.devland.is jobs: docker-build: - runs-on: ec2-runners - container: - image: ${{ vars.EC2_IMAGE }} + runs-on: ubuntu-20.04 timeout-minutes: 20 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 - name: Configure AWS credentials - # See https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services#requesting-the-access-token - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -32,53 +30,50 @@ jobs: - name: Login to Amazon ECR id: login-ecr - uses: aws-actions/amazon-ecr-login@v2 + uses: aws-actions/amazon-ecr-login@v1 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v1 - name: Cache Docker layers - uses: actions/cache@v4 + uses: actions/cache@v2 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-cache-${{ github.sha }} + key: ${{ runner.os }}-buildx-cache-v2-${{ github.sha }} restore-keys: | - ${{ runner.os }}-buildx-cache + ${{ runner.os }}-buildx-cache-v2 - name: Build and push uses: docker/build-push-action@v2 with: context: . push: true - tags: "${{ vars.CONTAINER_REGISTRY }}/dss:${{ github.sha }},${{ vars.CONTAINER_REGISTRY }}/dss:latest" + tags: "${{ env.DOCKER_REGISTRY }}/dss:${{ github.sha }},${{ env.DOCKER_REGISTRY }}/dss:latest" cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new - + - uses: nelonoel/branch-name@v1.0.1 - name: Trigger Deployment for service # if: github.ref == 'refs/heads/main' env: SPINNAKER_WEBHOOK_TOKEN: ${{ secrets.SPINNAKER_WEBHOOK_TOKEN }} run: | - set -x - echo "Sending webhook with branch: ${GITHUB_REF_NAME}" + echo "Sending webhook with branch: ${BRANCH_NAME}" curl $SPINNAKER_URL/webhooks/webhook/digital-signature-service -H "content-type: application/json" --data-binary @- <