Fixed: hostname #24
This file contains 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: Build & deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-push-container: | |
name: Build and Push Shortner Container | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build docker container | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./ | |
load: true | |
tags: | | |
ghcr.io/scout-ch/thilo-shortener/thilo_shortener:latest | |
- name: Push docker container | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
context: ./ | |
tags: | | |
ghcr.io/scout-ch/thilo-shortener/thilo_shortener:latest | |
buildNGINXConf: | |
name: Build NGINX Conf | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install PyYAML | |
- name: Run the script | |
run: | | |
python3 ./convertToNginx.py | |
- name: Add to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nginx_conf | |
path: ./nginx.conf | |
deployProd: | |
name: Deploy Thilo Link Shortner Prod | |
needs: buildNGINXConf | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: nginx_conf | |
- run: ls -la | |
- name: 📂 Sync files | |
uses: SamKirkland/[email protected] | |
with: | |
server: ${{ secrets.FTP_SERVER }} | |
username: ${{ secrets.FTP_USER }} | |
password: ${{ secrets.FTP_PASSWORD }} | |
protocol: ftps | |
server-dir: /conf/ |