Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
View runs Go to file
 
 
Cannot retrieve contributors at this time
name: Deploy EOEFANS CHALLENGE to Cloudflare pages
on:
push:
branches: [ "main","ci" ]
# pull_request:
# types: [synchronize, closed]
# branches: [ "main","ci" ]
# Environment variables available to all jobs and steps in this workflow
env:
APP_LOCATION: "./" # location of your client code
APP_ARTIFACT_LOCATION: "./" # location of client code build output
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
PROJECT_NAME: eoefans-challenge
permissions:
contents: read
jobs:
build_and_deploy_job:
permissions:
contents: read
deployments: write
pull-requests: write # for Azure/static-web-apps-deploy to comment on PRs
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: [ self-hosted, Linux ]
environment:
name: 'Production'
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
name: Deploy
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-node@v3
name: Use Node.js ${{ matrix.node-version }}
with:
node-version: ${{ matrix.node-version }}
- name: Publish
uses: cloudflare/pages-action@1
with:
apiToken: ${{ env.CLOUDFLARE_API_TOKEN }}
accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ env.PROJECT_NAME }} # e.g. 'my-project'
directory: ${{ env.APP_ARTIFACT_LOCATION }} # e.g. 'dist'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
close_pull_request_job:
permissions:
contents: none
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: [ self-hosted, Linux ]
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: cloudflare/pages-action@1
with:
apiToken: ${{ env.CLOUDFLARE_API_TOKEN }}
accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ env.RPOJECT_NAME }} # e.g. 'my-project'
directory: ${{ env.APP_ARTIFACT_LOCATION }} # e.g. 'dist'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}