-
Notifications
You must be signed in to change notification settings - Fork 1
32 lines (26 loc) · 963 Bytes
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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.