feat: deploy blog via scp
All checks were successful
Build and deploy website / Build and Push Jekyll Site (push) Successful in 23s
All checks were successful
Build and deploy website / Build and Push Jekyll Site (push) Successful in 23s
This commit is contained in:
parent
a444cfb022
commit
06e94159b1
1 changed files with 12 additions and 59 deletions
|
@ -1,4 +1,4 @@
|
|||
name: "Build and publish docker image"
|
||||
name: "Build and deploy website"
|
||||
|
||||
on:
|
||||
push:
|
||||
|
@ -8,7 +8,6 @@ on:
|
|||
- .gitignore
|
||||
- README.md
|
||||
- LICENSE
|
||||
- docker-compose.yml
|
||||
|
||||
# Allow one concurrent deployment
|
||||
concurrency:
|
||||
|
@ -16,8 +15,8 @@ concurrency:
|
|||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-site:
|
||||
name: Build Jekyll Site
|
||||
build-push:
|
||||
name: Build and Push Jekyll Site
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
@ -48,59 +47,13 @@ jobs:
|
|||
\-\-disable-external \
|
||||
\-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
|
||||
|
||||
# Upload artifact
|
||||
- name: Upload artifacts
|
||||
uses: forgejo/upload-artifact@v4 # temporary fork until actions/upload-artifact supports GHES
|
||||
- name: Copy website to destination server
|
||||
uses: https://github.com/garygrossgarten/github-action-scp@release
|
||||
with:
|
||||
name: jekyll-chirpy-blog
|
||||
path: _site
|
||||
retention-days: 1
|
||||
|
||||
build-docker:
|
||||
name: Build Docker Image
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-site
|
||||
|
||||
permissions:
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
|
||||
# Needed so that download artifacts knows it's a local repo
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download artifacts
|
||||
uses: forgejo/download-artifact@v4 # temporary fork until actions/download-artifact supports GHES
|
||||
|
||||
- name: Move to correct directory
|
||||
run: |
|
||||
mv jekyll-chirpy-blog _site
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
# - name: Set up QEMU
|
||||
# uses: docker/setup-qemu-action@v3
|
||||
#
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
# Login to fogejo registry
|
||||
- name: Login to Forgejo ${{ env.GITHUB_SERVER_URL }} registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.GITHUB_SERVER_URL }}
|
||||
username: ${{ env.GITHUB_REPOSITORY_OWNER }}
|
||||
password: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
|
||||
|
||||
# Check how to push to forgejo's repo
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: git.martin.md/radu/blog:latest
|
||||
local: _site
|
||||
remote: /srv/docker/nginx/html/blog
|
||||
host: ${{ secrets.SSH_HOST }}
|
||||
port: ${{ secrets.SSH_PORT }}
|
||||
username: ${{ secrets.SSH_USER }}
|
||||
privateKey: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
rmRemote: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue