Skip to content

Build, Deploy and Release Artifact #11

Build, Deploy and Release Artifact

Build, Deploy and Release Artifact #11

Workflow file for this run

name: Build and Release Artifact
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Nix
uses: cachix/install-nix-action@v16
- name: Build Archive
id: build_archive
run: |
make archive
if [ ! -f "wire-docs.tar.gz" ]; then
echo "Artifact not found!"
mv wire-docs.tar.gz wire-docs-${{ github.ref_name }}.tar.gz
exit 1
fi
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: eu-west-1
- name: Extract and Deploy docs to S3
run: |
mkdir -p tmp_extracted
tar -xzf ./wire-docs-${{ github.ref_name }}.tar.gz -C tmp_extracted
aws s3 sync tmp_extracted/ s3://origin-docs.zinfradev.com/
rm -rf tmp_extracted
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./wire-docs-${{ github.ref_name }}.tar.gz
asset_name: wire-docs-${{ github.ref_name }}.tar.gz
asset_content_type: application/gzip