fbla-cs-competition/.forgejo/workflows/start.yaml
Workflow config file is invalid. Please check your config file: Line: 4 Column 5: Failed to match job-factory: Line: 30 Column 9: Failed to match run-step: Line: 31 Column 9: Unknown Property uses Line: 32 Column 9: Unknown Property with Line: 30 Column 9: Failed to match regular-step: Line: 36 Column 17: Unknown Variable Access forgejo_repository Line: 4 Column 5: Failed to match workflow-job: Line: 7 Column 5: Unknown Property steps Forgejo Actions YAML Schema validation error
devaine 1736e9eb09
Some checks failed
/ build (push) Failing after 0s
/ deploy (push) Failing after 16s
feat(initial commit): first commit, testing out deployment
2026-05-10 16:50:19 -05:00

88 lines
2.6 KiB
YAML

on: [push]
jobs:
build:
runs-on: docker
container:
image: node:latest
steps:
- run: |
unset HISTFILE
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
- name: Checkout repo
uses: actions/checkout@v6
- name: Login to Forgejo Container Registry
uses: docker/login-action@v4
with:
# NOTE: Used for Forgejo Runner variables
registry: ${{ vars.REGISTRY_DOMAIN }}
username: ${{ vars.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and Push the Application
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ vars.REGISTRY_DOMAIN }}/${{ FORGEJO_REPOSITORY }}:app
file: Dockerfile
- name: Logout and Cleanup
run: |
docker logout ${{ vars.REGISTRY_DOMAIN }}
rm -rf ~/.*history
rm -rf ~/.docker/config.json
#- run: |
# ls -la
# echo "test"
# Will probably SSH into docker instance
#
deploy:
runs-on: docker
container:
image: ubuntu:latest
steps:
- name: Prerequisite, grab essential packages and remotely connect to the server.
run: |
# Get Prerequisite Packages
unset HISTFILE
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
# Begin setting up SSH w/ Secrets
mkdir ~/.ssh
install -m 600 -D /dev/null ~/.ssh/${{ secrets.DEPLOY_USER }}
echo "${{ secrets.DEPLOY_KEY }}" | base64 -d > ~/.ssh/${{ secrets.DEPLOY_USER }}
ssh-keyscan -H -p ${{ secrets.DEPLOY_PORT }} ${{ secrets.DEPLOY_HOST }} > ~/.ssh/known_hosts
printf "Host deploy\nPort ${{ secrets.DEPLOY_PORT }}\nHostname ${{ secrets.DEPLOY_HOST }}\nIdentityFile ~/.ssh/${{ secrets.DEPLOY_USER }}\nUser ${{ secrets.DEPLOY_USER }}" > ~/.ssh/config
docker context create deploy --docker "host=ssh://deploy"
docker context use deploy
- name: Checkout repo
uses: actions/checkout@v6
- name: Write secrets in an .env file
run: |
echo ${{ secrets.API_PORT }} >> .env
- name: Use the docker-compose.yml file to refresh the instance
run: |
# Check to see if we have checked out the repo.
docker compose down
docker compose pull
docker compose up -d