add api docs #19
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 Production | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Install doctl. | |
- name: Install doctl | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DO_ACCESS_TOKEN }} | |
# Build a Docker image of the application and tag the image with the $GITHUB_SHA. | |
- name: Build backend image | |
run: docker build -t registry.digitalocean.com/programming-languages/backend:$(echo $GITHUB_SHA | head -c7) ./backend | |
- name: Build web image | |
run: docker build -t registry.digitalocean.com/programming-languages/web:$(echo $GITHUB_SHA | head -c7) ./frontend | |
- name: Log in to DigitalOcean Container Registry with short-lived credentials | |
run: doctl registry login --expiry-seconds 1200 | |
# Push the Docker image to registry | |
- name: Push backend image | |
run: docker push registry.digitalocean.com/programming-languages/backend:$(echo $GITHUB_SHA | head -c7) | |
- name: Push web image | |
run: docker push registry.digitalocean.com/programming-languages/web:$(echo $GITHUB_SHA | head -c7) | |
# tag as latest | |
- name: Tag backend image | |
run: docker tag registry.digitalocean.com/programming-languages/backend:$(echo $GITHUB_SHA | head -c7) registry.digitalocean.com/programming-languages/backend:latest | |
- name: Tag web image | |
run: docker tag registry.digitalocean.com/programming-languages/web:$(echo $GITHUB_SHA | head -c7) registry.digitalocean.com/programming-languages/web:latest | |
# Push the Docker image to registry | |
- name: Push backend image | |
run: docker push registry.digitalocean.com/programming-languages/backend:latest | |
- name: Push web image | |
run: docker push registry.digitalocean.com/programming-languages/web:latest |