chore: fix typo #7
Workflow file for this run
This file contains hidden or 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: Production | |
on: | |
push: | |
tags: | |
- "**" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to Container Registry | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Get the latest tag | |
id: gettag | |
run: | | |
git fetch --tags | |
echo ::set-output name=TAG::$(git describe --tags $(git rev-list --tags --max-count=1)) | |
- name: Create Deployment Files | |
shell: bash | |
env: | |
LOKI: ${{ secrets.LOKI_URL }} | |
CADDY: ${{ secrets.CADDY_FILE }} | |
AINV: ${{ secrets.ANSIBLE_INVENTORY }} | |
APKEY: ${{ secrets.ANSIBLE_PRIVATE_KEY }} | |
run: | | |
echo "$AINV" > ./ansible/inventory.ini | |
echo "$APKEY" > ./ansible/key.pem | |
echo "$CADDY" > ./ansible/Caddyfile | |
chmod 400 ./ansible/key.pem | |
sed -i "s#LOKI-REPLACE-ME#$LOKI#g" ./ansible/docker-compose.yml | |
sed -i "s#<LATEST_PROD>#${{ steps.gettag.outputs.TAG }}#g" ./ansible/docker-compose.yml | |
- name: Build Image | |
run: docker build -t witnet/staking-leaderboard:${{github.ref_name}} -f ./Dockerfile . | |
- name: Publish Image | |
run: docker push witnet/staking-leaderboard:${{github.ref_name}} | |
- name: Deploy with Ansible | |
shell: bash | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
run: | | |
cd ansible | |
ansible-galaxy install -r requirements.yml | |
export ANSIBLE_CONFIG=./ansible.cfg | |
ansible-playbook playbook.yml -vv |