From 27b7f9a97ded09ad378248a7bae9f84ef84c47b2 Mon Sep 17 00:00:00 2001 From: Elliot Courant Date: Sat, 25 Sep 2021 20:46:52 -0500 Subject: [PATCH] Upgrading to new container flow --- .github/deploy.yml | 9 +++++++-- .github/workflows/incoming.yml | 17 +++++++++++++---- .github/workflows/main.yaml | 26 ++++++++++++++++---------- 3 files changed, 36 insertions(+), 16 deletions(-) diff --git a/.github/deploy.yml b/.github/deploy.yml index 132a2ef7..e385125e 100644 --- a/.github/deploy.yml +++ b/.github/deploy.yml @@ -1,6 +1,11 @@ - staging: environment: staging production_environment: false - required_contexts: [] + required_contexts: [ ] + auto_merge: false + +acceptance: + environment: acceptance + production_environment: false + required_contexts: [ ] auto_merge: false \ No newline at end of file diff --git a/.github/workflows/incoming.yml b/.github/workflows/incoming.yml index 68d6b623..8c6fdc94 100644 --- a/.github/workflows/incoming.yml +++ b/.github/workflows/incoming.yml @@ -1,4 +1,4 @@ -name: GitHub +name: Pull Request on: push: @@ -6,6 +6,15 @@ on: - staging - trying +permissions: + actions: read + deployments: none + issues: none + packages: none + pull-requests: none + repository-projects: none + security-events: none + jobs: test: name: Test @@ -82,11 +91,11 @@ jobs: - run: make dependencies - run: make docs - run: $GITHUB_WORKSPACE/node_modules/.bin/redoc-cli bundle $GITHUB_WORKSPACE/docs/swagger.yaml -o $GITHUB_WORKSPACE/docs/index.html - docker: + container: needs: - - test + - "test" - "pg-test" - name: Docker + name: Container runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 25eeadf8..106f293e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -78,17 +78,23 @@ jobs: name: Container runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Build and push ghcr.io - uses: docker/build-push-action@v1 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Container Timestamp + id: timestamp + run: echo "::set-output name=date::$(date -u +"%Y-%m-%dT%H:%M:%SZ")" + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - dockerfile: Dockerfile - path: . - tags: ${{ env.GITHUB_SHA }} - repository: monetr/rest-api + build-args: | + REVISION=${{ env.GITHUB_SHA }} + BUILD_TIME=${{ steps.timestamp.outputs.date }} + push: true + platforms: linux/amd64,linux/arm64 + tags: monetr/rest-api:${{ env.GITHUB_SHA }} docs-deploy: needs: - test