Fixes one unit test #41
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: CI/CD actions | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Check out repository code | |
uses: actions/checkout@v2 | |
- | |
name: Run tests | |
run: docker-compose run test | |
build-deploy: | |
runs-on: ubuntu-latest | |
needs: test | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- | |
name: Log in to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- | |
name: Push to Docker Hub | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
build-args: ENV=production | |
labels: | | |
git_commit=${{ github.sha }} | |
github_run_id=${{ github.run_id }} | |
github_run_number=${{ github.run_number }} | |
tags: ${{ secrets.DOCKER_USERNAME }}/althingi-source:${{ github.run_id }}, ${{ secrets.DOCKER_USERNAME }}/althingi-source:latest | |
- | |
name: Build versioning | |
run: | | |
echo outputs.digest: ${{ steps.docker_build.outputs.digest }} | |
echo github.commit: ${{ github.sha }} | |
echo github.run_number ${{ github.run_number }} | |
echo github.run_id: ${{ github.run_id }} | |
# - | |
# name: Deploy container to server | |
# uses: appleboy/ssh-action@master | |
# with: | |
# script: /var/app/bin/source | |
# host: ${{ secrets.SSH_HOST }} | |
# username: ${{ secrets.SSH_USER }} | |
# passphrase: ${{ secrets.SSH_PASSPHRASE }} | |
# key: ${{ secrets.SSH_KEY }} | |