Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

Commit

Permalink
Building container for google.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotcourant committed Sep 30, 2021
1 parent 7687d8f commit ac95b83
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/acceptance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- cron: 0 17 * * * # Noon in central time.
workflow_dispatch: { }

env:
PROJECT_ID: acceptance-327322

jobs:
commits:
# Determine the commits that need to be deployed to each environment.
Expand Down Expand Up @@ -106,8 +109,10 @@ jobs:
- "commits"
- "test"
- "pg-test"
name: Container
name: Google Container
runs-on: ubuntu-latest
environment:
name: acceptance
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -116,25 +121,26 @@ jobs:
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
- name: Login to Google Artifact Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.GAR_JSON_KEY }}
- name: Container Timestamp
id: timestamp
run: echo "::set-output name=build_time::$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
build-args: |
REVISION=${{ needs.commits.outputs.acceptance_commit }}
BUILD_TIME=${{ steps.timestamp.outputs.build_time }}
push: true
platforms: "linux/amd64"
tags: "ghcr.io/monetr/rest-api:${{ needs.commits.outputs.acceptance_commit }}"
tags: "us-docker.pkg.dev/${{ env.PROJECT_ID }}/monetr-containers/rest-api:${{ needs.commits.outputs.acceptance_commit }}"

acceptance:
needs:
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
workflow:
rules:
- if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "staging" || $CI_COMMIT_BRANCH == "trying" || $CI_COMMIT_BRANCH == "dog" || $CI_COMMIT_BRANCH == "acceptance"'
when: always
when: never
- if: '$CI_COMMIT_BRANCH == "staging" || $CI_COMMIT_BRANCH == "trying"'
when: never
- if: '$CI_COMMIT_BRANCH =~ /(.tmp)/'
Expand Down

0 comments on commit ac95b83

Please sign in to comment.