Fix Docker and Rust Install #38
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: Deploy to Server | |
on: | |
push: | |
branches: | |
- "main" | |
workflow_dispatch: | |
jobs: | |
install_rust: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Update Repositories | |
run: sudo apt-get update | |
- name: Install Cargo | |
run: sudo apt-get install cargo | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [macos-latest, ubuntu-22.04, windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build | |
run: cargo build --release | |
upload: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Upload Release | |
uses: actions/upload-release@v1 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: target/release/ashland-area-amateur-radio-club | |
asset_name: aaarc | |
tag: ${{ github.ref }} | |
release_title: ${{ github.ref }} | |
build_docker_image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | |
uses: actions/checkout@v4 | |
- name: Build Image | |
run: | | |
docker build -t ${{ secrets.DOCKER_HUB_USERNAME }}/aaarc . | |
- name: Login to Docker Hub | |
run: | | |
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: Push Image | |
run: | | |
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/aaarc |