Skip to content

Tdd contributor uniqueness (#2010) #965

Tdd contributor uniqueness (#2010)

Tdd contributor uniqueness (#2010) #965

Workflow file for this run

name: Continuous Deployment
on:
push:
branches: [ main ]
jobs:
docker_push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# GitHub Actions do not expose the commit date, so we need to
# store it in an env variable ourselves.
- name: Get commit date
id: git_commit_date
run: "echo GIT_COMMIT_DATE=$(git log -1 --format=%cd --date=iso-strict ${{ github.sha }}) >> $GITHUB_ENV"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: tactilenews/hundred-eyes:latest
build-args: |
git_commit_sha=${{ github.sha }}
git_commit_date=${{ env.GIT_COMMIT_DATE }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
deploy:
needs: [docker_push]
runs-on: ubuntu-latest
concurrency: staging_environment
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Inject passlib in ansible venv
run: pipx inject ansible-core passlib
- name: Run playbook
uses: dawidd6/action-ansible-playbook@009b88e9b8894bd8838475d799b7dca5024e91d5
with:
playbook: ansible/site.yml
requirements: ansible/requirements.yml
key: ${{secrets.SSH_PRIVATE_KEY}}
vault_password: ${{secrets.VAULT_PASSWORD}}
options: |
--inventory ansible/inventories/staging
--skip-tags skip_ci
--verbose