fix when acl allow is null #69
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
name: Build and Deploy Refactor | |
on: | |
push: | |
branches: [hotfix/*] | |
env: | |
REGISTRY: ghcr.io | |
REGISTRY_USERNAME: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} | |
REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.REGISTRY }}/bcgov/api-services-portal/api-services-portal | |
- name: Docker meta Feeder | |
id: docker_meta_feeder | |
uses: docker/metadata-action@v3 | |
with: | |
images: ${{ env.REGISTRY }}/bcgov/api-services-portal/data-feeder | |
- name: Set DEPLOY_ID which will deploy a custom deploy to 'dev' environment | |
run: | | |
echo '::set-output name=DEPLOY_ID::${{ steps.docker_meta.outputs.version }}' | |
echo '::set-output name=APP_VERSION::${{ fromJSON(steps.docker_meta.outputs.json).labels['org.opencontainers.image.version'] }}' | |
echo '::set-output name=APP_REVISION::${{ fromJSON(steps.docker_meta.outputs.json).labels['org.opencontainers.image.revision'] }}' | |
id: set-deploy-id | |
- name: Get deploy ID | |
run: echo "The DEPLOY_ID is ${{ steps.set-deploy-id.outputs.DEPLOY_ID }}" | |
- uses: actions/checkout@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ env.REGISTRY_USERNAME }} | |
password: ${{ env.REGISTRY_PASSWORD }} | |
- uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build Feeder | |
uses: docker/build-push-action@v2 | |
with: | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
context: feeds | |
file: feeds/Dockerfile | |
tags: ${{ steps.docker_meta_feeder.outputs.tags }} | |
push: true | |
build-args: | | |
GITHUB_API_TOKEN=${{ secrets.CONTAINER_REGISTRY_PASSWORD }} | |
APP_VERSION=${{ steps.set-deploy-id.outputs.APP_VERSION }} | |
APP_REVISION=${{ steps.set-deploy-id.outputs.APP_REVISION }} | |
- name: Build Portal | |
uses: docker/build-push-action@v2 | |
with: | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
context: . | |
file: Dockerfile | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
push: true | |
build-args: | | |
GITHUB_API_TOKEN=${{ secrets.CONTAINER_REGISTRY_PASSWORD }} | |
APP_VERSION=${{ steps.set-deploy-id.outputs.APP_VERSION }} | |
APP_REVISION=${{ steps.set-deploy-id.outputs.APP_REVISION }} | |