Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a CD to Netlify #18

Merged
merged 9 commits into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Deploy Netlify

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build-and-deploy:
runs-on: ubuntu-22.04
timeout-minutes: 10


steps:
- uses: actions/checkout@v3

- uses: subosito/[email protected]
with:
flutter-version: '3.22.2'

- name: Make .env
working-directory: flutter_bird_app
run: |
touch .env
echo WALLET_CONNECT_PROJECT_ID=${{secrets.WALLET_CONNECT_PROJECT_ID}} >> .env
Mdaiki0730 marked this conversation as resolved.
Show resolved Hide resolved

- name: Show version
working-directory: flutter_bird_app
run: flutter --version

- name: Install packages
working-directory: flutter_bird_app
run: flutter pub get

- name: Build
working-directory: flutter_bird_app
run: flutter build web

- name: Set GitHub Deployment Environment
id: github_deployment_environment
run: |
if [ "$GITHUB_EVENT_NAME" = "push" ]; then
echo "GITHUB_DEPLOYMENT_ENVIRONMENT=Netlify prd" >> "${GITHUB_OUTPUT}"
else
echo "GITHUB_DEPLOYMENT_ENVIRONMENT=Netlify Preview" >> "${GITHUB_OUTPUT}"
fi

- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './flutter_bird_app/build/web'
production-branch: master
github-deployment-environment: ${{ steps.github_deployment_environment.outputs.GITHUB_DEPLOYMENT_ENVIRONMENT }}
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: ${{ github.event.head_commit.message || github.event.pull_request.title }}
alias: deploy-preview-${{ github.event.number }}
fails-without-credentials: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_PAT }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
Loading