Skip to content

Commit

Permalink
adding ci to build container (#1)
Browse files Browse the repository at this point in the history
* adding ci to build container
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Apr 28, 2022
1 parent 4813265 commit 8a1d6ae
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Deploy Layer Container
on:
pull_request: []
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
fail-fast: false
matrix:

# base image # dockerfile
container: [["ubuntu:20.04", Dockerfile]]

name: Build ${{ matrix.container[0] }} ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Container Name
env:
base: ${{ matrix.container[0] }}
run: |
base=$(echo ${base/:/-})
container="ghcr.io/researchapps/awscli-layer-${base}:latest"
echo "container=${container}" >> $GITHUB_ENV
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Simple Docker Build
run: docker build -t ${{ env.container }} --build-arg base=${{ matrix.container[0] }} .

- name: Deploy
if: ${{ github.event_name != 'pull_request' }}
run: docker push ${{ env.container }}

0 comments on commit 8a1d6ae

Please sign in to comment.