-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github/workflows+test_args.sh: Separate Linux and Docker builds
Update test_args.sh to be runnable in GH action ubuntu env
- Loading branch information
Showing
3 changed files
with
158 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Docker Build | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build: | ||
runs-on: ubuntu-16.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
# Needed for commands that depend on git tags | ||
fetch-depth: 0 | ||
- name: Set global environment variables | ||
run: | | ||
echo "PKG_CONFIG_PATH=/root/compiled/lib/pkgconfig" >> $GITHUB_ENV | ||
echo "GOPATH=/go" >> $GITHUB_ENV | ||
- name: DockerHub login | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASS }} | ||
- name: Build Linux specific builder container | ||
run: | | ||
docker pull livepeerci/build-platform:latest || echo 'no pre-existing cache found' | ||
docker build -t livepeerci/build-platform:latest --cache-from=livepeerci/build-platform:latest -f docker/Dockerfile.build-linux . | ||
docker push livepeerci/build-platform:latest | ||
- name: Build livepeer in a container shared between Linux and Windows | ||
run: | | ||
docker pull livepeerci/build:latest || echo 'no pre-existing cache found' | ||
./ci_env.sh docker build --build-arg HIGHEST_CHAIN_TAG -t livepeerci/build:latest --cache-from=livepeerci/build:latest -f docker/Dockerfile.build . | ||
docker push livepeerci/build:latest | ||
- name: Build minimal livepeer distributable | ||
run: | | ||
# We publish two tags for each build: | ||
# livepeer/go-livepeer:BRANCH_NAME and livepeer/go-livepeer:VERSION_STRING. Both are useful | ||
# to pull from in different contexts. | ||
# Our Docker tag name should be our branch name with just alphanums | ||
BRANCH_TAG=$(echo $GITHUB_REF | sed 's/refs\/heads\///' | sed 's/\//-/g' | tr -cd '[:alnum:]_-') | ||
VERSION_TAG=$(./print_version.sh) | ||
docker build -t current-build -f docker/Dockerfile.release-linux . | ||
for TAG in $BRANCH_TAG $VERSION_TAG; do | ||
docker tag current-build livepeer/go-livepeer:${TAG}-linux | ||
docker push livepeer/go-livepeer:${TAG}-linux | ||
# Manifest step is optional in case the Windows build hasn't finished yet | ||
docker manifest create livepeer/go-livepeer:${TAG} livepeer/go-livepeer:${TAG}-linux livepeer/go-livepeer:${TAG}-windows || true | ||
docker manifest push livepeer/go-livepeer:${TAG} || true | ||
done | ||
env: | ||
GITHUB_REF: ${{ github.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters