website/.forgejo/workflows/deploy.yaml

22 lines
756 B
YAML
Raw Permalink Normal View History

2023-12-10 03:50:42 -06:00
name: deploy
on:
2024-02-25 17:58:43 -06:00
push:
branches:
- main
2023-12-10 03:50:42 -06:00
jobs:
deploy:
runs-on: docker
2023-12-10 19:58:04 -06:00
container:
2023-12-10 20:05:54 -06:00
image: nseguin42/forgejo-runner:ubuntu
2023-12-10 20:02:52 -06:00
env:
DOCKER_HOST: tcp://0.0.0.0:2375
2023-12-10 03:50:42 -06:00
steps:
2023-12-10 20:08:53 -06:00
- name: docker login
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
2023-12-10 03:50:42 -06:00
- uses: actions/checkout@v4
- name: docker build
2024-02-25 17:26:44 -06:00
run: if [ -z "$(docker images -q nseguin42/website:${{ github.sha }} 2> /dev/null)" ]; then docker build -t nseguin42/website:${{ github.sha }} .; fi
2023-12-10 20:05:25 -06:00
- name: docker tag
2024-02-25 17:26:44 -06:00
run: docker tag nseguin42/website:${{ github.sha }} nseguin42/website:latest
2023-12-10 03:50:42 -06:00
- name: docker push
2024-02-25 17:35:23 -06:00
run: docker push nseguin42/website:latest