aboutsummaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/docker.yml
blob: 1b704fddf637bf38ca7923fcb32ba9f38a42714c (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# This is the Github action to build and push the tinygo/tinygo-dev Docker image.
# If you are looking for the tinygo/tinygo "release" Docker image please see
# https://github.com/tinygo-org/docker
#
name: Docker
on:
  push:
    branches: [ dev, fix-docker-llvm-build ]

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  push_to_registry:
    name: build-push-dev
    runs-on: ubuntu-latest
    permissions:
      packages: write
      contents: read
    steps:
      - name: Check out the repo
        uses: actions/checkout@v2
        with:
          submodules: recursive
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      - name: Docker meta
        id: meta
        uses: docker/metadata-action@v3
        with:
          images: |
            tinygo/tinygo-dev
            ghcr.io/${{ github.repository }}/tinygo-dev
          tags: |
            type=sha,format=long
            type=raw,value=latest
      - name: Log in to Docker Hub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKER_HUB_USERNAME }}
          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
      - name: Log in to Github Container Registry
        uses: docker/login-action@v1
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - name: Build and push
        uses: docker/build-push-action@v2
        with:
          context: .
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          cache-from: type=gha
          cache-to: type=gha,mode=max
      - name: Trigger Drivers repo build on Github Actions
        run: |
          curl -X POST \
          -H "Authorization: Bearer ${{secrets.GHA_ACCESS_TOKEN}}" \
          -H "Accept: application/vnd.github.v3+json" \
          https://api.github.com/repos/tinygo-org/drivers/actions/workflows/build.yml/dispatches \
          -d '{"ref": "dev"}'
      - name: Trigger Bluetooth repo build on Github Actions
        run: |
          curl -X POST \
          -H "Authorization: Bearer ${{secrets.GHA_ACCESS_TOKEN}}" \
          -H "Accept: application/vnd.github.v3+json" \
          https://api.github.com/repos/tinygo-org/bluetooth/actions/workflows/linux.yml/dispatches \
          -d '{"ref": "dev"}'
      - name: Trigger TinyFS repo build on CircleCI
        run: |
          curl --location --request POST 'https://circleci.com/api/v2/project/github/tinygo-org/tinyfs/pipeline' \
            --header 'Content-Type: application/json' \
            -d '{"branch": "dev"}' \
            -u "${{ secrets.CIRCLECI_API_TOKEN }}"
      - name: Trigger TinyFont repo build on CircleCI
        run: |
          curl --location --request POST 'https://circleci.com/api/v2/project/github/tinygo-org/tinyfont/pipeline' \
            --header 'Content-Type: application/json' \
            -d '{"branch": "dev"}' \
            -u "${{ secrets.CIRCLECI_API_TOKEN }}"
      - name: Trigger TinyDraw repo build on CircleCI
        run: |
          curl --location --request POST 'https://circleci.com/api/v2/project/github/tinygo-org/tinydraw/pipeline' \
            --header 'Content-Type: application/json' \
            -d '{"branch": "dev"}' \
            -u "${{ secrets.CIRCLECI_API_TOKEN }}"