Build docker image using github actions #8
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: Build Docker Image | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }}-{{ github.event_name }} | |
cancel-in-progress: true | |
jobs: | |
build-docker-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Add SHORT_SHA env property with commit short sha | |
run: | | |
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7) | |
echo "SHORT_SHA=$SHORT_SHA" >> $GITHUB_ENV | |
echo "Short SHA: $SHORT_SHA" | |
- name: Make docker image | |
working-directory: . | |
run: make docker-build | |
env: | |
ETLHASH: stellar/stellar-etl-dev:${SHORT_SHA} | |
- name: Push docker image | |
working-directory: . | |
run: docker push stellar/stellar-etl-dev:${SHORT_SHA} |