Skip to content

chore(ui): add new svgs #16

chore(ui): add new svgs

chore(ui): add new svgs #16

Workflow file for this run

name: Production
on:
push:
tags:
- "**"
jobs:
deploy:
runs-on: ubuntu-latest
environment: Production
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 }}
API_ENDPOINT: ${{ secrets.API_ENDPOINT }}
STAGING_API_ENDPOINT: ${{ secrets.STAGING_API_ENDPOINT }}
APKEY: ${{ secrets.ANSIBLE_PRIVATE_KEY }}
ENVARS: ${{ vars.ENVARS }}
run: |
echo "$AINV" > ./ansible/inventory.ini
echo "$APKEY" > ./ansible/key.pem
echo "$CADDY" > ./ansible/Caddyfile
echo "$ENVARS" > ./ansible/production.env
echo "$ENVARS" > ./packages/api/.env
echo "$ENVARS" > ./packages/ui/.env
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
sed -i "s#<PRODUCTION_API_ENDPOINT>#$API_ENDPOINT#g" ./ansible/docker-compose.yml
sed -i "s#<STAGING_API_ENDPOINT>#$STAGING_API_ENDPOINT#g" ./ansible/docker-compose.yml
- name: Pull & Rebuild Images
env:
API_ENDPOINT: ${{ secrets.API_ENDPOINT }}
run: |
docker pull witnet/data-feed-app-ui:latest
docker pull witnet/data-feed-app-api:latest
docker build --build-arg API_ENDPOINT=${{ secrets.API_ENDPOINT }} -t witnet/data-feed-app-ui:${{github.ref_name}} -f ./ansible/docker/ui.dockerfile ./packages/ui
docker tag witnet/data-feed-app-api:latest witnet/data-feed-app-api:${{github.ref_name}}
- name: Publish Containers
run: |
docker push witnet/data-feed-app-ui:${{github.ref_name}}
docker push witnet/data-feed-app-api:${{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
export ANSIBLE_FORCE_COLOR=True
export ANSIBLE_STDOUT_CALLBACK=yaml
export FORCE_COLOR=1
export TERM=xterm-color
ansible-playbook playbook.yml -vv