generated from hjess/PythonTemplateProject
Some checks failed
Build, Push, and Deploy to Nomad with Waypoint / docker-waypoint-nomad (push) Failing after 18s
47 lines
1.6 KiB
YAML
47 lines
1.6 KiB
YAML
name: Build, Push, and Deploy to Nomad with Waypoint
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
docker-waypoint-nomad:
|
|
runs-on: self-hosted
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Log in to Container Registry
|
|
run: echo ${{ secrets.password }} | docker login registry.i80.dk -u ${{ secrets.username }} --password-stdin
|
|
|
|
- name: Build Docker Image
|
|
run: |
|
|
COMMIT_HASH=$(git rev-parse --short HEAD)
|
|
docker build -t registry.i80.dk/gitea/lifefaq:latest -t registry.i80.dk/gitea/lifefaq:${COMMIT_HASH} .
|
|
|
|
- name: Push Docker Image
|
|
run: |
|
|
COMMIT_HASH=$(git rev-parse --short HEAD)
|
|
docker push registry.i80.dk/gitea/lifefaq:${COMMIT_HASH}
|
|
docker push registry.i80.dk/gitea/lifefaq:latest
|
|
|
|
# - name: Install Waypoint CLI
|
|
# run: curl -sLo /usr/local/bin/waypoint https://releases.hashicorp.com/waypoint/0.11.1/waypoint_0.11.1_linux_amd64.zip && chmod +x /usr/local/bin/waypoint
|
|
|
|
- name: Initialize Waypoint Project
|
|
run: waypoint init
|
|
|
|
- name: Deploy with Waypoint
|
|
env:
|
|
WAYPOINT_SERVER_ADDR: https://waypoint.i80.dk
|
|
run: |
|
|
COMMIT_HASH=$(git rev-parse --short HEAD)
|
|
waypoint up -var "image_tag=${COMMIT_HASH}"
|
|
|
|
- name: Update Nginx Configuration
|
|
run: ssh runner@nomad sudo /opt/nginx_updater/venv/bin/python3 /opt/nginx_updater/nginx_updater.py lifefaq
|
|
|
|
- name: Update Forwarder Configuration
|
|
run: ssh runner@nomad sudo /opt/nginx_updater/venv/bin/python3 /opt/nginx_updater/update_forwarder.py --subdomain lifefaq
|