๐Ÿ“ฆ ionic-team / ionic-cli

๐Ÿ“„ cd.yml ยท 52 lines
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
52name: CD

on:
  push:
    branches:
      - stable

jobs:
  build:
    name: Build, Test, and Deploy
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
      - uses: actions/setup-node@v3
        with:
          node-version: 14.x
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Restore Dependency Cache
        uses: actions/cache@v3
        with:
          path: ~/.npm
          key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
      - run: npm install
      - run: npm run bootstrap
      - run: npm run publish:ci -- --yes
        env:
          GH_TOKEN: ${{ secrets.GH_TOKEN }}
          GIT_AUTHOR_NAME: Ionitron
          GIT_AUTHOR_EMAIL: hi@ionicframework.com
          GIT_COMMITTER_NAME: Ionitron
          GIT_COMMITTER_EMAIL: hi@ionicframework.com
      - name: Sleep while npm takes its time
        run: sleep 20
      - name: GitHub Container Registry Login
        run: echo ${GH_TOKEN} | docker login ghcr.io -u ionitron --password-stdin
        env:
          GH_TOKEN: ${{ secrets.GH_TOKEN }}
      - name: Build Container
        run: |
            docker build \
              --build-arg IONIC_CLI_VERSION=$(npm info @ionic/cli dist-tags.latest) \
              --tag ghcr.io/${{ github.repository }}:latest \
              --tag ghcr.io/${{ github.repository}}:$(npm info @ionic/cli dist-tags.latest) \
              .
      - name: Push Container as latest
        run: docker push ghcr.io/${{ github.repository }}:latest
      - name: Push Container as version
        run: docker push ghcr.io/${{ github.repository }}:$(npm info @ionic/cli dist-tags.latest)