name: Gatsby Publish

on:
  push:
    branches:
      - gatsby

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
      - run: yarn install
      - run: yarn run build
      - name: Archive content
        uses: actions/upload-artifact@v2
        with:
          name: ${{ github.sha }}-content
          path: |
            public
  deploy-gh-pages:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: enriikke/gatsby-gh-pages-action@v2
        with:
          access-token: ${{ secrets.ACCESS_TOKEN }}
          deploy-branch: gh-pages
  deploy-s3:
    runs-on: ubuntu-latest
    needs:
      - build
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
      - name: Download archive content
        uses: actions/download-artifact@v2
        with:
          name: ${{ github.sha }}-content
      - run: yarn install
      - run: yarn run deploy-s3
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_ACCESS_KEY_SECRET: ${{ secrets.AWS_ACCESS_KEY_SECRET }}


name: Gatsby Publish

on:
  push:
    branches:
      - gatsby

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
      - run: yarn install
      - run: yarn run build
      - run: 7z a content.zip public/
      - name: Archive content
        uses: actions/upload-artifact@v2
        with:
          name: ${{ github.sha }}-content.zip
          path: content.zip
#  deploy-gh-pages:
#    runs-on: ubuntu-latest
#    steps:
#      - uses: actions/checkout@v2
#      - uses: enriikke/gatsby-gh-pages-action@v2
#        with:
#          access-token: ${{ secrets.ACCESS_TOKEN }}
#          deploy-branch: gh-pages
  deploy-s3:
    runs-on: ubuntu-latest
    needs:
      - build
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
      - name: Download archive content
        uses: actions/download-artifact@v2
        with:
          name: ${{ github.sha }}-content.zip
          path: content.zip
      - run: 7z x content.zip public/
      - run: yarn install
      - run: yarn run deploy-s3
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_ACCESS_KEY_SECRET: ${{ secrets.AWS_ACCESS_KEY_SECRET }}


Use 7zip to pack archives
[CICD] Use 7zip to pack archives
