forked from TriForceX/MiyooCFW
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (61 loc) · 2.31 KB
/
build.yml
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
# based on https://github.com/Arcnor/MiyooCFW/blob/ci/.github/workflows/main.yml
name: Build
# Run on changes (including automated ones from the update job), allow manual triggering from the Actions tab
on: [push, pull_request, workflow_dispatch]
jobs:
# build-image:
# uses: MiyooCFW/buildroot/.github/workflows/build.yml@master
# with:
# submodule: buildroot
docker:
# needs: build-image
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
runs-on: ubuntu-22.04
env:
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
DOCKERHUB_USERNAME: miyoocfw
steps:
- uses: actions/checkout@v3
# download and extract the artifact
# - uses: actions/download-artifact@v3
# with:
# name: SDK (uClibc)
# - run: tar -xvf arm-miyoo-linux-uclibcgnueabi_sdk-buildroot.tar.gz
- name: Log into docker hub
#if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
# create token at https://hub.docker.com/settings/security
# token needs to have read, write, and delete permissions - read and write only leads to a login error (wtf?)
# set value at https://github.com/MiyooCFW/toolchain/settings/secrets/actions
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
#- name: Build and push Docker image
# id: build-and-push
# uses: docker/build-push-action@v2
# with:
# context: .
#push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}