Merge pull request #90 from osu-tournament-rating/deploy #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Staging and Production | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
environment: [Staging, Production] # Matrix strategy for environments | |
env: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
ENVIRONMENT: ${{ matrix.environment }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
run: echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin | |
- name: Build Docker image | |
run: docker build -t stagecodes/otr-processor:${{ matrix.environment }} . | |
- name: Push Docker image to Docker Hub | |
run: docker push stagecodes/otr-processor:${{ matrix.environment }} | |
# No deployment job beyond upload, the server will run the latest image when necessary. |