Feat: Prepare testing workflow #5
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 Website | |
on: | |
push: | |
branches: [ "main" ] | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Docker login | |
env: | |
DOCKER_USER: ${{secrets.DOCKER_USER}} | |
DOCKER_PSWD: ${{secrets.DOCKER_PSWD}} | |
run: | | |
docker login -u $DOCKER_USER -p $DOCKER_PSWD | |
- name: Docker build and push | |
env: | |
DOCKER_USER: ${{secrets.DOCKER_USER}} | |
DOCKER_PSWD: ${{secrets.DOCKER_PSWD}} | |
run: | | |
docker login -u $DOCKER_USER -p $DOCKER_PSWD | |
docker build . -t michaelthamm/website:$GITHUB_REF_NAME | |
docker push michaelthamm/website:$GITHUB_REF_NAME | |
test-local: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Test index.html links | |
run: | | |
. ./app/tests/test-urls.sh | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: akhileshns/[email protected] | |
with: | |
heroku_api_key: ${{secrets.HEROKU_API_KEY}} | |
heroku_email: ${{secrets.HEROKU_EMAIL}} | |
heroku_app_name: "michaelthamm-website" | |
test-deployed: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Audit URLs using Lighthouse | |
uses: treosh/lighthouse-ci-action@v10 | |
with: | |
urls: | | |
https://www.michaelthamm.com/ | |
budgetPath: ./app/tests/budget.json # test performance budgets | |
uploadArtifacts: true # save results as an action artifacts | |
temporaryPublicStorage: true # upload lighthouse report to the temporary storage |