-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6fa0de6
commit ff1bc7d
Showing
3 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Build and deploy on Deuxfleurs infra | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: deploy-to-deuxfleurs | ||
jobs: | ||
build_and_publish: | ||
runs-on: ubuntu-latest | ||
env: | ||
HUGO_VERSION: 0.125.2 | ||
HUGO_ENV: production | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
- name: Install Dart Sass | ||
run: sudo snap install dart-sass | ||
- name: Install Hugo CLI | ||
run: | | ||
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ | ||
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb | ||
- name: Build Hugo | ||
run: | | ||
hugo -b "${{secrets.BASE_URL}}" | ||
- name: Install AWS CLI | ||
uses: unfor19/install-aws-cli-action@v1 | ||
- name: Deploy to Deuxfleurs | ||
run: | | ||
touch ~/.awsrc | ||
echo "export AWS_ACCESS_KEY_ID=${{secrets.AWS_ACCESS_KEY_ID}}" >> ~/.awsrc | ||
echo "export AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}}" >> ~/.awsrc | ||
echo "export AWS_DEFAULT_REGION='garage'" >> ~/.awsrc | ||
mkdir ~/.aws | ||
touch ~/.aws/credentials | ||
echo "[default]" >> ~/.aws/credentials | ||
echo "aws_access_key_id = ${{secrets.AWS_ACCESS_KEY_ID}}" >> ~/.aws/credentials | ||
echo "aws_secret_access_key = ${{secrets.AWS_SECRET_ACCESS_KEY}}" >> ~/.aws/credentials | ||
echo "region = garage" >> ~/.aws/credentials | ||
function aws { command aws --endpoint-url https://garage.deuxfleurs.fr $@ ; } | ||
aws --version | ||
source ~/.awsrc | ||
aws s3 website now-playing.web.deuxfleurs.fr --index-document index.html --error-document 404.html | ||
aws s3 sync --delete public s3://now-playing |
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
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