summaryrefslogtreecommitdiff
path: root/.github/workflows/sync-github-releases.yaml
blob: af3245f1ba0480ade31b64ae7afefd873835b907 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Sync all github releases with erlang.org

## Sync all github releases + prs every hour
on:
  workflow_dispatch:
  schedule:
  ## In UTC
  - cron: '0 * * * *'

## Build base images to be used by other github workflows
jobs:

  sync-releases:
    if: github.repository == 'erlang/otp'
    concurrency: sync-github-releases
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      ## We need to login to the package registry in order to pull
      ## the base debian image.
      - name: Docker login
        run: docker login https://docker.pkg.github.com -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
      - name: Sync releases
        env:
          ERLANG_ORG_TOKEN: ${{ secrets.TRIGGER_ERLANG_ORG_BUILD }}
        run: >
          .github/scripts/sync-github-releases.sh ${{ github.repository }}
          "Bearer ${{ secrets.GITHUB_TOKEN }}" "^[2-9][1-9]\\..*" 25m

  sync-prs:
    if: github.repository == 'erlang/otp'
    concurrency: erlang.github.io-deploy
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
        with:
          token: ${{ secrets.ERLANG_TOKEN }}
          repository: 'erlang/erlang.github.io'
          path: erlang.github.io
      - uses: actions/checkout@v2
      - name: Update PRs
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
        run: |
            git clone https://github.com/talentdeficit/jsx
            (cd jsx && rebar3 compile)
            rm -rf "${GITHUB_WORKSPACE}/erlang.github.io/.git"
            mkdir -p "${GITHUB_WORKSPACE}/erlang.github.io/prs/"
            touch "${GITHUB_WORKSPACE}/erlang.github.io/.nojekyll"
            .github/scripts/sync-github-prs.es erlang/otp "${GITHUB_WORKSPACE}/erlang.github.io/prs/"

      - name: Deploy to github pages 🚀
        uses: JamesIves/github-pages-deploy-action@v4.2.2
        with:
          token: ${{ secrets.ERLANG_TOKEN }}
          branch: master # The branch the action should deploy to.
          folder: erlang.github.io # The folder the action should deploy.
          repository-name: erlang/erlang.github.io
          single-commit: true