Skip to content

Commit

Permalink
Prepare workflow for migration (#2)
Browse files Browse the repository at this point in the history
This PR just changes our GitHub workflow configurations related to the fork.

Will be testing this out with @giacomolicari 😄.

Docker images are now pulled from the GitHub container registry instead of Docker Hub.
  • Loading branch information
Nicholas Rodrigues Lordello committed Apr 4, 2022
1 parent aea85ab commit 1878e1d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 37 deletions.
5 changes: 1 addition & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
# https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/about-code-owners
# This automatically requests reviews from the team for non draft PRs and allows
# us to enforce that PR approvals come from the team.
* @Gnosis/gp-services
* @cowprotocol/backend

55 changes: 46 additions & 9 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,50 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
env:
AUTODEPLOY_TAG: develop
AUTODEPLOY_URL: https://dfusion.auto.gnosisdev.com/services/dfusion-v2-api-rinkeby,dfusion-v2-solver-rinkeby,dfusion-v2-api-mainnet,dfusion-v2-solver-mainnet,dfusion-v2-api-xdai,dfusion-v2-solver-xdai,dfusion-v2-solver-shadow,dfusion-v2-alerter-mainnet/rollout
DOCKERHUB_PROJECT: gp-v2-services
DOCKER_NAME: ${{ secrets.DOCKER_NAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
AUTODEPLOY_TOKEN: ${{ secrets.AUTODEPLOY_TOKEN }}
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v2
- run: docker/deploy.sh ${GITHUB_REF#refs/*/}
- uses: actions/checkout@v3

- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: meta_services
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
labels: |
org.opencontainers.image.licenses=GPL-3.0-or-later
- uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile
push: true
tags: ${{ steps.meta_services.outputs.tags }}
labels: ${{ steps.meta_services.outputs.labels }}

- id: meta_migration
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}-migration
labels: |
org.opencontainers.image.licenses=GPL-3.0-or-later
- uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile.migration
push: true
tags: ${{ steps.meta_migration.outputs.tags }}
labels: ${{ steps.meta_migration.outputs.labels }}

- uses: cowprotocol/autodeploy-action@v1
if: ${{ github.ref == 'refs/heads/main' }}
with:
pods: dfusion-v2-api-rinkeby,dfusion-v2-solver-rinkeby,dfusion-v2-api-mainnet,dfusion-v2-solver-mainnet,dfusion-v2-api-xdai,dfusion-v2-solver-xdai,dfusion-v2-solver-shadow,dfusion-v2-alerter-mainnet
url: ${{ secrets.AUTODEPLOY_URL }}
token: ${{ secrets.AUTODEPLOY_TOKEN }}
24 changes: 0 additions & 24 deletions docker/deploy.sh

This file was deleted.

0 comments on commit 1878e1d

Please sign in to comment.