Docker Image CI #128
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
name: Docker Image CI | |
on: | |
schedule: | |
- cron: 0 0 * * 6 | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: neuralegion/devops | |
strategy: | |
matrix: | |
package: | |
- chromium | |
- chromium-headful | |
- chrome | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ vars.AWS_DEFAULT_REGION }} | |
- name: Get version | |
id: get_version | |
run: echo ::set-output name=result::$(make --file ${{ matrix.package }}/Makefile get-version) | |
- name: Build image | |
run: make --file ${{ matrix.package }}/Makefile build version=${{ steps.get_version.outputs.result }} | |
- name: Login into Docker | |
run: docker login --username=anatol1988 --password=${{ secrets.DOCKER_TOKEN }} | |
- name: Push image to Docker | |
run: docker push neuralegion/nextools-${{ matrix.package }} | |
- name: Login in ECR | |
run: eval $(aws ecr get-login --no-include-email) | |
- name: Push Docker image to AWS ECR | |
run: docker push 454884832027.dkr.ecr.us-east-1.amazonaws.com/nextools-${{ matrix.package }} | |