Skip to content

Commit

Permalink
Merge pull request #58 from cmeyer18/use-local-docker-reg
Browse files Browse the repository at this point in the history
Use local docker reg
  • Loading branch information
cmeyer18 committed May 17, 2024
2 parents 5c8afaa + e59c2b7 commit c736d7f
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,35 @@ jobs:
steps:
- uses: actions/checkout@v4.1.5

- name: Login to Tailscale
uses: tailscale/github-action@main
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci

- name: Login to docker
uses: docker/login-action@v3.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: git.prod.carsonnetworks.net
username: ${{ secrets.GITEA_USERNAME }}
password: ${{ secrets.GITEA_PAT }}

- name: Build docker image
run: docker build . -t cdmeyer/weather-db-migrations:${{github.run_number}}
run: docker build . -t git.prod.carsonnetworks.net/cdmeyer/weather-db-migrations:${{github.run_number}}
working-directory: sql/db_migrations

- name: Create docker tags
if: github.ref == 'refs/heads/master'
run: |
docker tag cdmeyer/weather-db-migrations:${{github.run_number}} cdmeyer/weather-db-migrations:${{ needs.build.outputs.version }}
docker tag cdmeyer/weather-db-migrations:${{github.run_number}} cdmeyer/weather-db-migrations:latest-release
docker tag git.prod.carsonnetworks.net/cdmeyer/weather-db-migrations:${{github.run_number}} git.prod.carsonnetworks.net/cdmeyer/weather-db-migrations:${{ needs.build.outputs.version }}
docker tag git.prod.carsonnetworks.net/cdmeyer/weather-db-migrations:${{github.run_number}} git.prod.carsonnetworks.net/cdmeyer/weather-db-migrations:latest-release
- name: Push build tag
run: docker push cdmeyer/weather-db-migrations:${{github.run_number}}
run: docker push git.prod.carsonnetworks.net/cdmeyer/weather-db-migrations:${{github.run_number}}

- name: Push release tags
if: github.ref == 'refs/heads/master'
run: |
docker push cdmeyer/weather-db-migrations:${{ needs.build.outputs.version }}
docker push cdmeyer/weather-db-migrations:latest-release
docker push git.prod.carsonnetworks.net/cdmeyer/weather-db-migrations:${{ needs.build.outputs.version }}
docker push git.prod.carsonnetworks.net/cdmeyer/weather-db-migrations:latest-release

0 comments on commit c736d7f

Please sign in to comment.