Skip to content

Merge pull request #1762 from tactilenews/1753_add_ability_to_delete_… #818

Merge pull request #1762 from tactilenews/1753_add_ability_to_delete_…

Merge pull request #1762 from tactilenews/1753_add_ability_to_delete_… #818

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: 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