Skip to content

login to docker

login to docker #5

Workflow file for this run

name: Rust
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: docker build -t ghcr.io/ducc/calories:$GITHUB_SHA -t ghcr.io/ducc/calories:latest -f Dockerfile .
- name: Push sha
if: github.ref == 'refs/heads/master'
run: docker push ghcr.io/ducc/calories:$GITHUB_SHA
- name: Docker login
if: github.ref == 'refs/heads/master'
run: echo ${{ secrets.PACKAGES_ACCESS_TOKEN }} | docker login ghcr.io -u ducc --password-stdin
- name: Push latest
if: github.ref == 'refs/heads/master'
run: docker push ghcr.io/ducc/calories:latest