The direct route is all freeway, and not rideable.
You can take BART (commuter train) from the SF airport to about 1-1.5 miles from the oakland amtrak. It costs about $4, takes around an hour, and you are allowed to take your bike on during non-rush-hour times. google "bay area rapid transit" for more info.
trying to do this with a boxed bike and luggage would be a pain in the butt, but you could probably do it. You would need to take a taxi the mile to the amtrack station.
The dumbarton is the only transbay bridge that allows cycling. you can ride south down the peninsula to Menlo Park, ride across the Dumbarton Bridge (hwy 84), which has an excellent, safe, separate bike lane, and then find your way up through the maze of high-density city from Fremont to Oakland. There are definitely city-street ways to do this. Not necessarily nice riding, though.
If you are trying to find the best way to get to Astoria (or nearby), you might look into renting a one-way rental car. It might cost a little more, but save a bunch of time and some scheduling headaches. I think you'll have to re-box your bike for amtrack, so you could also avoid that hassle. If there are 2 or more of you, it would almost certainly be more cost-effective than the train. You might have to return your car in portland, and then ride or hitch out to astoria. There are at least 2 ways to do that ride, i have done the one along the columbia river (hwy 30, if i recall correctly) and it was just fine, and completely straightforward. there is an RV park in the middle. It took 1 1/4 days.
Or you could just catch a connecting flight to portland and start there.
Also, if you are willing to spend a little time and take your chances, you can try craigslist.org (bay area version) and post a note on their rideshare listing.
sorry, too much information....
good luck!
anna