Skip to content

Commit

Permalink
Switch toolchain to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Jan 20, 2021
1 parent 443eba7 commit 5b3b324
Show file tree
Hide file tree
Showing 12 changed files with 304 additions and 170 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*

!Dockerfile
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ indent_size = 4
indent_style = tab
indent_size = 4

[{*.bats,*.sh,post_push,post_push.tmpl.php}]
[*.{bats,sh}]
indent_style = space
indent_size = 2

Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: CI

on:
pull_request:
push:
schedule:
- cron: '0 12 * * 3'

env:
PUBLISH: ${{ github.event_name == 'push'
&& (startsWith(github.ref, 'refs/tags/0')
|| startsWith(github.ref, 'refs/tags/1')
|| startsWith(github.ref, 'refs/tags/2')
|| startsWith(github.ref, 'refs/tags/3')
|| startsWith(github.ref, 'refs/tags/4')
|| startsWith(github.ref, 'refs/tags/5')
|| startsWith(github.ref, 'refs/tags/6')
|| startsWith(github.ref, 'refs/tags/7')
|| startsWith(github.ref, 'refs/tags/8')
|| startsWith(github.ref, 'refs/tags/9')) }}

jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1

- uses: satackey/[email protected]
continue-on-error: true
if: ${{ env.PUBLISH != 'true' && github.ref != 'refs/heads/master' }}
- run: make docker.image no-cache=no tag=build-${{ github.run_number }}
if: ${{ env.PUBLISH != 'true' && github.ref != 'refs/heads/master' }}

- run: make docker.image no-cache=yes tag=build-${{ github.run_number }}
if: ${{ env.PUBLISH == 'true' || github.ref == 'refs/heads/master' }}

- run: make npm.install
- run: make test.docker tag=build-${{ github.run_number }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GCR_BOT_PAT }}
if: ${{ env.PUBLISH == 'true' }}
- name: Login to Quay.io
uses: docker/login-action@v1
with:
registry: quay.io
username: instrumentisto+bot
password: ${{ secrets.QUAYIO_ROBOT_TOKEN }}
if: ${{ env.PUBLISH == 'true' }}
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: instrumentistobot
password: ${{ secrets.DOCKERHUB_BOT_PASS }}
if: ${{ env.PUBLISH == 'true' }}

- run: make docker.tags of=build-${{ github.run_number }}
if: ${{ env.PUBLISH == 'true' }}
- run: make docker.push
if: ${{ env.PUBLISH == 'true' }}

# On GitHub Container Registry README is automatically updated on pushes.
- name: Update README on Quay.io
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_APIKEY: ${{ secrets.QUAYIO_API_TOKEN }}
with:
provider: quay
destination_container_repo: quay.io/instrumentisto/geckodriver
readme_file: README.md
if: ${{ env.PUBLISH == 'true' }}
- name: Update README on Docker Hub
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_USER: instrumentistobot
DOCKER_PASS: ${{ secrets.DOCKERHUB_BOT_PASS }}
with:
provider: dockerhub
destination_container_repo: instrumentisto/geckodriver
readme_file: README.md
if: ${{ env.PUBLISH == 'true' }}

- name: Parse release version from Git tag
id: release
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
if: ${{ env.PUBLISH == 'true' }}
- name: Parse CHANGELOG link
id: changelog
run: echo ::set-output name=LINK::https://github.com/${{ github.repository }}/blob/${{ steps.release.outputs.VERSION }}/CHANGELOG.md#$(sed -n '/^## \[${{ steps.release.outputs.VERSION }}\]/{s/^## \[\(.*\)\][^0-9]*\([0-9].*\)/\1--\2/;s/[^0-9a-z-]*//g;p;}' CHANGELOG.md)
if: ${{ env.PUBLISH == 'true' }}
- name: Release on GitHub
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.release.outputs.VERSION }}
release_name: ${{ steps.release.outputs.VERSION }}
body: |
[Changelog](${{ steps.changelog.outputs.LINK }})
if: ${{ env.PUBLISH == 'true' }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
.DS_Store

/node_modules/
/package-lock.json
/yarn.lock
/yarn-error.log
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
geckodriver image changelog
===========================

All user visible changes to this project will be documented in this file. This project uses [Semantic Versioning 2.0.0].




## [84.0.2-driver0.29.0-r0] · 2021-01-19
[84.0.2-driver0.29.0-r0]: /../../tree/84.0.2-driver0.29.0-r0

[Diff](/../../compare/eb70d69cfbb923e4c219c1631a0fee404f192ee2...84.0.2-driver0.29.0-r0)

### Upgraded

- geckodriver 0.29.0: <https://github.com/mozilla/geckodriver/releases/tag/v0.29.0>

### Fixed

- Absent `MOZ_HEADLESS=1` env var to ensure headless mode ([#4], [#3]).

[#3]: /../../issues/3
[#4]: /../../pull/4




## Previous releases

See [GitHub commits](/../../commits?after=63c662a83d1a9851c7cd81f35d0f5b646dbcdb84+0).





[Semantic Versioning 2.0.0]: https://semver.org
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ FROM debian:buster-slim

ARG firefox_ver=84.0.2
ARG geckodriver_ver=0.29.0
ARG build_rev=0

LABEL org.opencontainers.image.source="\
https://github.com/instrumentisto/geckodriver-docker-image"


RUN apt-get update \
&& apt-get upgrade -y \
Expand Down Expand Up @@ -43,6 +48,7 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* \
/tmp/*


# As this image cannot run in non-headless mode anyway, it's better to forcibly
# enable it, regardless whether WebDriver client requests it in capabilities or
# not.
Expand Down
Loading

1 comment on commit 5b3b324

@tyranron
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@quite4work toolchain switched to the same workflow as with Haraka and GitLab Builder Docker images.

Please sign in to comment.