.github/workflows/build.yml #14
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
on: [workflow_dispatch] | |
jobs: | |
build: | |
runs-on: macos-latest | |
name: Build the project | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Run your project's build step | |
# - name: Build | |
# run: npm install && npm run build | |
- name: Set up node | |
# ADD YOUR CUSTOM DEPENDENCY UPGRADE COMMANDS BELOW | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
- name: Load secret | |
uses: 1password/load-secrets-action@v1 | |
with: | |
# Export loaded secrets as environment variables | |
export-env: true | |
env: | |
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
AWS_KEY_ID: "op://DevOps/cloudflare-r2-token/access-key-id" | |
AWS_SECRET_ACCESS_KEY: "op://DevOps/cloudflare-r2-token/secret-access-key" | |
ENDPOINT: "op://DevOps/cloudflare-r2-token/endpoint" | |
- name: | |
Install JS dependencies and build | |
# ADD YOUR CUSTOM DEPENDENCY UPGRADE COMMANDS BELOW | |
run: | | |
npm ci && npm run build-ios | |
env: | |
VITE_POLICY_KEY: ${{ secrets.VITE_POLICY_KEY }} | |
VITE_BC_ACCOUNT_ID: ${{ secrets.VITE_BC_ACCOUNT_ID }} | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" | |
- name: zip the built folder | |
run: mkdir ./dottmp && zip -r ./dottmp/${{steps.date.outputs.date}}-dotapp ./ios | |
- name: Upload IOS to R2 | |
uses: shallwefootball/s3-upload-action@master | |
with: | |
aws_key_id: ${{ env.AWS_KEY_ID }} | |
aws_secret_access_key: ${{ env.AWS_SECRET_ACCESS_KEY}} | |
aws_bucket: dot-mobile | |
source_dir: "./dottmp" | |
destination_dir: "ios" | |
endpoint: ${{ env.ENDPOINT }} |