Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deploy #13

Merged
merged 3 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,26 @@ jobs:
name: metrics-image
path: /tmp/metrics.tar.gz

deploy:
required-checks:
if: always()

needs:
- check
- test
- docker-test-and-build
- lint-dockerfile

runs-on: Ubuntu-latest

steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}

deploy:
needs: [required-checks]

runs-on: ubuntu-latest

permissions:
Expand Down Expand Up @@ -121,20 +134,3 @@ jobs:
ssh-add - <<< "${{ secrets.DOKKU3_DEPLOY_SSH_KEY }}"
SHA=$(docker inspect --format='{{index .RepoDigests 0}}' "$PUBLIC_IMAGE_NAME":latest)
ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" [email protected] git:from-image metrics "$SHA"

required-checks:
if: always()

needs:
- check
- test
- docker-test-and-build
- lint-dockerfile

runs-on: Ubuntu-latest

steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}
18 changes: 11 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,27 @@ services:
extends:
service: metrics-prod
image: metrics-dev
container_name: metrics-dev
# running as a specific uid/gid allows files written to mounted volumes by
# the docker container's default user to match the host user's uid/gid, for
# convienience.
user: ${DEV_USERID:-1000}:${DEV_GROUPID:-1000}
build:
# the dev stage in the Dockerfile
target: metrics-dev
# pass the uid/gid as build arg
args:
- DEV_USERID=${DEV_USERID:-1000}
- DEV_GROUPID=${DEV_GROUPID:-1000}
container_name: metrics-dev
# running as a specific uid/gid allows files written to mounted volumes by
# the docker container's default user to match the host user's uid/gid, for
# convienience.
user: ${DEV_USERID:-1000}:${DEV_GROUPID:-1000}
volumes:
# mount our current code
- .:/app
env_file:
- .env
environment:
- GITHUB_TOKEN=${GITHUB_TOKEN:-}
- SLACK_SIGNING_SECRET=${SLACK_SIGNING_SECRET:-}
- SLACK_TECH_SUPPORT_CHANNEL_ID=${SLACK_TECH_SUPPORT_CHANNEL_ID:-}
- SLACK_TOKEN=${SLACK_TOKEN:-}
- TIMESCALEDB_URL=${TIMESCALEDB_URL:-}

volumes:
postgres:
Expand Down