feat: deploy blog via scp
Some checks failed
Build and deploy website / Build and Push Jekyll Site (push) Failing after 4s
Some checks failed
Build and deploy website / Build and Push Jekyll Site (push) Failing after 4s
This commit is contained in:
parent
a444cfb022
commit
d4e01d324a
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:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -8,7 +8,6 @@ on:
|
||||||
- .gitignore
|
- .gitignore
|
||||||
- README.md
|
- README.md
|
||||||
- LICENSE
|
- LICENSE
|
||||||
- docker-compose.yml
|
|
||||||
|
|
||||||
# Allow one concurrent deployment
|
# Allow one concurrent deployment
|
||||||
concurrency:
|
concurrency:
|
||||||
|
@ -16,8 +15,8 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-site:
|
build-push:
|
||||||
name: Build Jekyll Site
|
name: Build and Push Jekyll Site
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -48,59 +47,13 @@ jobs:
|
||||||
\-\-disable-external \
|
\-\-disable-external \
|
||||||
\-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
|
\-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
|
||||||
|
|
||||||
# Upload artifact
|
- name: Copy website to destination server
|
||||||
- name: Upload artifacts
|
uses: garygrossgarten/github-action-scp@release
|
||||||
uses: forgejo/upload-artifact@v4 # temporary fork until actions/upload-artifact supports GHES
|
|
||||||
with:
|
with:
|
||||||
name: jekyll-chirpy-blog
|
local: _site
|
||||||
path: _site
|
remote: /srv/docker/nginx/html/blog
|
||||||
retention-days: 1
|
host: ${{ secrets.SSH_HOST }}
|
||||||
|
port: ${{ secrets.SSH_PORT }}
|
||||||
build-docker:
|
username: ${{ secrets.SSH_USER }}
|
||||||
name: Build Docker Image
|
privateKey: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
runs-on: ubuntu-latest
|
rmRemote: true
|
||||||
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
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue